Professional JavaScript for Web Developers (eBook)
1104 Seiten
Wrox (Verlag)
978-1-394-19322-6 (ISBN)
Update and upgrade your JavaScript skillset for ES 2023 with the ultimate JavaScript guide for pros
Professional JavaScript for Web Developers, 5th edition, is the gold-standard in intermediate-to-advanced JavaScript programming development books. The author dives directly into the inner workings of JavaScript to help you clean up your code and become a more sophisticated and talented JavaScript developer. From object-oriented programming and inheritance to combining JavaScript with HTML and other markup languages, expert computer engineer Matt Frisbie walks you through everything you need to know to level-up your JavaScript game.
This new edition is updated to include ECMAScript 2023 and later standard releases, the most useful techniques, and a relentless focus on code that works seamlessly in mobile web browsers and with the latest common frameworks and libraries. With this book, you will:
- Get up to date with ECMAScript 2023
- Get acquainted with the newest frameworks and libraries
- Explore advanced topics such as web animation, workers, and the latest APIs
- Get a head start on future ES releases
- Learn to use modern syntax and best practices
- Understand how to optimize performance in JavaScript applications
- Master asynchronous programming patterns using promises, generators, and async/await
Perfect for those who think they already know JavaScript 'pretty well,' Professional JavaScript for Web Developers, 5th edition, is the pro-level update that intermediate and advanced web developers have been waiting for.
MATT FRISBIE has written four other books, Building Browser Extensions, Professional JavaScript for Web Developers 4th edition, Angular 2 Cookbook, and AngularJS Web Application Development Cookbook. He previously worked at Google and DoorDash, and currently runs his own consulting business. Matt is active in the JavaScript community, maintains multiple open source projects, and is a frequent guest on podcasts. He holds a Bachelor of Science in Computer Engineering from the University of Illinois Urbana-Champaign.
MATT FRISBIE has written four other books, Building Browser Extensions, Professional JavaScript for Web Developers 4th edition, Angular 2 Cookbook, and AngularJS Web Application Development Cookbook. He previously worked at Google and DoorDash, and currently runs his own consulting business. Matt is active in the JavaScript community, maintains multiple open source projects, and is a frequent guest on podcasts. He holds a Bachelor of Science in Computer Engineering from the University of Illinois Urbana-Champaign.
FOREWORD xliii
INTRODUCTION xlv
CHAPTER 1: WHAT IS JAVASCRIPT? 1
CHAPTER 2: JAVASCRIPT IN HTML 9
CHAPTER 3: LANGUAGE BASICS 19
CHAPTER 4: VARIABLES, SCOPE, AND MEMORY 97
CHAPTER 5: BASIC REFERENCE TYPES 119
CHAPTER 6: ADVANCED REFERENCE TYPES 159
CHAPTER 7: ITERATORS AND GENERATORS 217
CHAPTER 8: OBJECTS, CLASSES, AND OBJECT'ORIENTED PROGRAMMING 251
CHAPTER 9: PROXIES AND REFLECT 323
CHAPTER 10: FUNCTIONS 349
CHAPTER 11: PROMISES AND ASYNC/AWAIT 383
CHAPTER 12: THE BROWSER OBJECT MODEL 435
CHAPTER 13: THE DOCUMENT OBJECT MODEL 459
CHAPTER 14: DOM EXTENSIONS 507
CHAPTER 15: EVENTS 557
CHAPTER 16: ANIMATION AND GRAPHICS WITH CANVAS 609
CHAPTER 17: SCRIPTING FORMS 645
CHAPTER 18: JAVASCRIPT APIs 675
CHAPTER 19: ERROR HANDLING AND DEBUGGING 765
CHAPTER 20: JSON 791
CHAPTER 21: NETWORK REQUESTS AND REMOTE RESOURCES 801
CHAPTER 22: CLIENT'SIDE STORAGE 839
CHAPTER 23: MODULES 861
CHAPTER 24: WORKERS 887
CHAPTER 25: BEST PRACTICES 955
APPENDIX A: ES.NEXT 987
APPENDIX B: STRICT MODE 991
APPENDIX C: JAVASCRIPT LIBRARIES AND FRAMEWORKS 999
APPENDIX D: JAVASCRIPT TOOLS 1005
INDEX 1017
INTRODUCTION
A tech lead at Google once shared with me a compelling perspective on JavaScript: It's not really a programming language. The ECMA-262 specification defines JavaScript, but there is no single true implementation of it. Web browsers and their JavaScript engines all implement this specification as they see fit. Chrome has Blink/V8, Firefox has Gecko/SpiderMonkey, and Safari has WebKit/JavaScriptCore. What's more, the language swims in an ocean of supplementary specifications that govern APIs for everything that JavaScript touches: the DOM, network requests, system hardware, storage, events, files, cryptography, and hundreds of others. Therefore, JavaScript is more accurately characterized as a constellation of ECMAScript implementations buttressed by an API buffet.
The first edition of this book was published in 2005. Microsoft was still pushing its rogue JScript, Internet Explorer had over a 90 percent browser market share, mobile browsers were in the Stone Age, and jQuery wouldn't be released for another year. At the time this fifth edition was written in 2023, major browsers have coalesced around the ECMA-262 specification, over 70 percent of Internet traffic uses a Chromium-based browser, mobile browser traffic exceeds desktop traffic, and modern web development largely comprises manipulating frameworks like React and Angular.
Most web developers would identify the release of ECMAScript 6 as JavaScript's Cambrian explosion. Pre-ES6, the language advanced in infrequent and irregular lurches. A dire lack of critical language constructs led to ugly patterns, hacks, and fragmented workarounds. Post-ES6, the language enjoys more sophisticated and useful syntactical tools. Annual ECMAScript editions ensure the language addresses developer needs and stays abreast of industry trends. Modern JavaScript is beginner-friendly, is applicable in almost any domain, has an enormous development community, and enjoys a rich library of developer tools. As a result, developers flock to the language in droves: the Stack Overflow 2022 Developer Survey listed JavaScript as the most popular programming language for the 10th consecutive year.
In this book, JavaScript is covered from its very beginning in the earliest Netscape browsers to the present-day incarnations flush with support for a dizzying spectrum of browser technologies. The book covers many advanced topics in meticulous detail, yet it ensures the reader understands how to use these topics and where they are appropriate. In short, you learn how to apply JavaScript solutions to problems faced by web developers everywhere.
WHO THIS BOOK IS FOR
This book is aimed at three groups of readers:
- Experienced developers familiar with object-oriented programming who are looking to learn JavaScript as it relates to traditional OO languages such as Java and C++
- Web application developers attempting to enhance the usability of their websites and web applications
- Novice JavaScript developers aiming to better understand the language
In addition, familiarity with the following related technologies is a strong indicator that this book is for you:
- Compiled languages such as Java, C++, and Rust
- Interpreted languages such as Python, PHP, and Ruby
- HTML and CSS
This book is not aimed at beginners lacking a basic computer science background or those looking to add some simple user interactions to websites. These readers should instead refer to A Smarter Way to Learn JavaScript by Mark Myers (ASmarterWayToLearn.com, 2014).
WHAT THIS BOOK COVERS
Professional JavaScript for Web Developers, fifth edition, provides a developer-level introduction, along with the more advanced and useful features of JavaScript.
The book begins with an exploration of how JavaScript originated and evolved into what it is today. A detailed discussion of the components that make up a JavaScript implementation follows, with specific focus on standards such as ECMAScript and the Document Object Model (DOM).
Building on that base, the book moves on to cover basic concepts of JavaScript, including classes, promises, iterators, and proxies. This is followed by an in-depth examination of events, animations, forms, errors, and JSON.
The last part of the book is focused on the newest and most important additions to the language. This includes fetch, modules, web workers, service workers, and a collection of emerging APIs.
HOW THIS BOOK IS STRUCTURED
This book comprises the following chapters:
- What Is JavaScript?—Explains the origins of JavaScript: where it came from, how it evolved, and what it is today. Concepts introduced include the relationship between JavaScript and ECMAScript, the Document Object Model (DOM), and the Browser Object Model (BOM). A discussion of the relevant standards from the European Computer Manufacturer's Association (ECMA) and the World Wide Web Consortium (W3C) is also included.
- JavaScript in HTML—Examines how JavaScript is used in conjunction with HTML to create dynamic web pages. Introduces the various ways of embedding JavaScript into a page and includes a discussion surrounding the JavaScript content-type and its relationship to the
<script>
element. - Language Basics—Introduces basic language concepts, including syntax and flow control statements. Explains the syntactic similarities of JavaScript and other C-based languages and points out the differences. Type coercion is introduced as it relates to built-in operators. Covers all language primitives, including the
Symbol
type. - Variables, Scope, and Memory—Explores how variables are handled in JavaScript given their loosely typed nature. A discussion of the differences between primitive and reference values is included, as is information about execution context as it relates to variables. Also, a discussion about garbage collection in JavaScript covers how memory is reclaimed when variables go out of scope.
- Basic Reference Types—Covers all of the details regarding JavaScript's built-in reference types, such as
Date
,Regexp
, primitives, and primitive wrappers. Each reference type is discussed both in theory and in how they relate to browser implementations. - Advanced Reference Types—Continues the book's coverage of built-in reference types with
Object
,Array
,Map
,WeakRef
,WeakMap
,Set
, andWeakSet
. - Iterators and Generators—Introduces iterators and generators and discusses both in terms of their most fundamental behavior as well as how they are used in relation to existing language constructs.
- Objects, Classes, and Object-Oriented Programming—Explains how to use classes and object-oriented programming in JavaScript. Begins with an in-depth discussion of the JavaScript Object type and continues into coverage of prototypal inheritance. Following this is a complete discussion of classes and how they are a close sibling of prototypal inheritance.
- Proxies and Reflect—Introduces two closely related concepts: Proxy and the Reflect API. These can be used to intercept and shim additional behavior into fundamental operations within the language.
- Functions—Explores one of the most powerful aspects of JavaScript: function expressions. Topics include closures, the
this
object, the module pattern, the creation of private object members, arrow functions, default parameters, and spread operators. - Promises and Async/Await—Introduces two new closely related asynchronous programming constructs: the
Promise
type andasync/await
. The chapter begins with a discussion of the asynchronous JavaScript paradigm and continues into coverage of how promises are used and their relationship to async functions. - The Browser Object Model—Introduces the Browser Object Model (BOM), which is responsible for objects allowing interaction with the browser itself. Each of the BOM objects is covered, including window, document, location, navigator, and screen.
- The Document Object Model—Introduces the Document Object Model (DOM) objects available in JavaScript as defined in DOM Level 1. Features an in-depth exploration of the entire DOM and how it allows developers to manipulate a page.
- DOM Extensions—Explains how other APIs, as well as the browsers themselves, extend the DOM with more functionality such as the Selectors API, the Element Traversal API, and HTML5 extensions. Discusses how DOM Levels 2 and 3 augmented the DOM with additional properties, methods, and objects. Includes coverage of DOM4 additions such as resize, intersection, and mutation observers.
- Events—Explains the nature of events in JavaScript, where they originated, and how the DOM redefined how events should work.
- Animation and Graphics with Canvas—Discusses the
<canvas>
tag and how to use it to create on-the-fly graphics. Both the 2D context and the WebGL (3D) context are covered, providing you with a good starting point for creating animations and games. Includes coverage of both WebGL1 and WebGL2. - Scripting Forms—Explores using JavaScript to enhance form interactions and work around browser limitations. Discussion focuses on individual...
Erscheint lt. Verlag | 18.8.2023 |
---|---|
Reihe/Serie | Tech Today |
Sprache | englisch |
Themenwelt | Informatik ► Web / Internet ► JavaScript |
Schlagworte | Computer Science • Informatik • JavaScript • Object Technologies • Objektorientiertes Programmieren • Programmierung • Programmierung u. Software-Entwicklung • Programming & Software Development • Web-Entwicklung • Web Site Development |
ISBN-10 | 1-394-19322-X / 139419322X |
ISBN-13 | 978-1-394-19322-6 / 9781394193226 |
Haben Sie eine Frage zum Produkt? |
Größe: 5,2 MB
Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM
Dateiformat: EPUB (Electronic Publication)
EPUB ist ein offener Standard für eBooks und eignet sich besonders zur Darstellung von Belletristik und Sachbüchern. Der Fließtext wird dynamisch an die Display- und Schriftgröße angepasst. Auch für mobile Lesegeräte ist EPUB daher gut geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine
Geräteliste und zusätzliche Hinweise
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich