Introduction |
|
xxxi | |
|
Chapter 1 The New Toys In Es2015--Es2020, And Beyond |
|
|
1 | (1) |
|
Definitions, Who's Who, and Terminology |
|
|
2 | (2) |
|
|
2 | (1) |
|
ES6? ES7? ES2015? ES2020? |
|
|
2 | (1) |
|
JavaScript "Engines," Browsers, and Others |
|
|
3 | (1) |
|
|
4 | (2) |
|
How Do New Toys Get Created? |
|
|
6 | (3) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
Keeping Up with the New Toys |
|
|
9 | (1) |
|
Using Today's Toys in Yesterday's Environments, and Tomorrow's toys Today |
|
|
10 | (5) |
|
Transpiling an Example with Babel |
|
|
11 | (4) |
|
|
15 | (2) |
|
Chapter 2 Block-Scoped Declarations: Let And Const |
|
|
17 | (22) |
|
An Introduction to let and const |
|
|
18 | (1) |
|
|
18 | (1) |
|
Repeated Declarations Are an Error |
|
|
19 | (1) |
|
Hoisting and the Temporal Dead Zone |
|
|
20 | (2) |
|
|
22 | (2) |
|
const: Constants for JavaScript |
|
|
24 | (2) |
|
|
24 | (1) |
|
Objects Referenced by a const Are Still Mutable |
|
|
25 | (1) |
|
|
26 | (10) |
|
The "Closures in Loops" Problem |
|
|
26 | (2) |
|
Bindings: How Variables, Constants, and Other Identifiers Work |
|
|
28 | (5) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
36 | (3) |
|
Use const or let Instead of var |
|
|
36 | (1) |
|
Keep Variables Narrowly Scoped |
|
|
37 | (1) |
|
Use Block Scope Instead of Inline Anonymous Functions |
|
|
37 | (2) |
|
Chapter 3 New Function Features |
|
|
39 | (26) |
|
Arrow Functions and Lexical this, super, etc. |
|
|
40 | (5) |
|
|
40 | (4) |
|
Arrow Functions and Lexical this |
|
|
44 | (1) |
|
Arrow Functions Cannot Be Constructors |
|
|
45 | (1) |
|
|
45 | (5) |
|
|
46 | (1) |
|
Defaults Are Evaluated in Their Own Scope |
|
|
47 | (2) |
|
Defaults Don't Add to the Arity of the Function |
|
|
49 | (1) |
|
|
50 | (2) |
|
Trailing Commas in Parameter Lists and Function Calls |
|
|
52 | (1) |
|
The Function name Property |
|
|
53 | (2) |
|
Function Declarations in Blocks |
|
|
55 | (5) |
|
Function Declarations in Blocks: Standard Semantics |
|
|
57 | (1) |
|
Function Declarations in Blocks: Legacy Web Semantics |
|
|
58 | (2) |
|
|
60 | (5) |
|
Use Arrow Functions Instead of Various this Value Workarounds |
|
|
60 | (1) |
|
Use Arrow Functions for Callbacks When Not Using this or arguments |
|
|
61 | (1) |
|
Consider Arrow Functions Elsewhere As Well |
|
|
61 | (1) |
|
Don't Use Arrow Functions When the Caller Needs to Control the Value of this |
|
|
62 | (1) |
|
Use Default Parameter Values Rather Than Code Providing Defaults |
|
|
62 | (1) |
|
Use a Rest Parameter Instead of the arguments Keyword |
|
|
63 | (1) |
|
Consider Trailing Commas If Warranted |
|
|
63 | (2) |
|
|
65 | (40) |
|
|
66 | (1) |
|
Introducing the New class Syntax |
|
|
66 | (9) |
|
|
68 | (2) |
|
Adding Instance Properties |
|
|
70 | (1) |
|
Adding a Prototype Method |
|
|
70 | (2) |
|
|
72 | (1) |
|
Adding an Accessor Property |
|
|
73 | (1) |
|
|
74 | (1) |
|
Comparing with the Older Syntax |
|
|
75 | (2) |
|
|
77 | (20) |
|
|
81 | (1) |
|
Writing Subclass Constructors |
|
|
81 | (2) |
|
Inheriting and Accessing Superclass Prototype Properties and Methods |
|
|
83 | (3) |
|
Inheriting Static Methods |
|
|
86 | (2) |
|
|
88 | (1) |
|
Methods Returning New Instances |
|
|
88 | (5) |
|
|
93 | (1) |
|
|
94 | (3) |
|
Leaving Off Object.prototype |
|
|
97 | (1) |
|
|
98 | (3) |
|
Class Declarations vs. class Expressions |
|
|
101 | (2) |
|
|
101 | (1) |
|
|
102 | (1) |
|
|
103 | (1) |
|
|
104 | (1) |
|
Use class When Creating Constructor Functions |
|
|
104 | (1) |
|
Chapter 5 New Object Features |
|
|
105 | (26) |
|
|
106 | (1) |
|
|
107 | (1) |
|
Getting and Setting an Object's Prototype |
|
|
107 | (2) |
|
|
107 | (1) |
|
The_proto_Property on Browsers |
|
|
108 | (1) |
|
The_proto_Literal Property Name on Browsers |
|
|
109 | (1) |
|
Method Syntax, and super Outside Classes |
|
|
109 | (3) |
|
|
112 | (8) |
|
|
112 | (2) |
|
Creating and Using Symbols |
|
|
114 | (1) |
|
Symbols Are Not for Privacy |
|
|
115 | (1) |
|
|
115 | (4) |
|
|
119 | (1) |
|
|
120 | (3) |
|
|
120 | (1) |
|
|
121 | (1) |
|
|
122 | (1) |
|
|
122 | (1) |
|
|
122 | (1) |
|
Object.getOwnPropertySymbols |
|
|
122 | (1) |
|
Object.getOwnPropertyDescriptors |
|
|
123 | (1) |
|
|
123 | (2) |
|
|
125 | (2) |
|
|
127 | (1) |
|
|
128 | (3) |
|
Use Computed Syntax When Creating Properties with Dynamic Names |
|
|
128 | (1) |
|
Use Shorthand Syntax When Initializing a Property from a Variable with the Same Name |
|
|
128 | (1) |
|
Use Object.assign instead of Custom "Extend" Functions or Copying All Properties Explicitly |
|
|
129 | (1) |
|
Use Spread Syntax When Creating a New Object Based on an Existing Object's Properties |
|
|
129 | (1) |
|
Use Symbol to Avoid Name Collision |
|
|
129 | (1) |
|
Use Object.getPrototypeOf/setPrototypeOf Instead of proto |
|
|
129 | (1) |
|
Use Method Syntax for Methods |
|
|
130 | (1) |
|
Chapter 6 Iterables, Iterators, For-Of, Iterable Spread, Generators |
|
|
131 | (34) |
|
Iterators, Iterables, the for-of Loop, and Iterable Spread Syntax |
|
|
131 | (15) |
|
|
132 | (1) |
|
The for-of Loop: Using an Iterator Implicitly |
|
|
132 | (1) |
|
Using an Iterator Explicitly |
|
|
133 | (2) |
|
|
135 | (1) |
|
Iterator Prototype Objects |
|
|
136 | (2) |
|
Making Something Iterable |
|
|
138 | (4) |
|
|
142 | (1) |
|
|
143 | (1) |
|
Iterators, for-of, and the DOM |
|
|
144 | (2) |
|
|
146 | (17) |
|
A Basic Generator Function Just Producing Values |
|
|
147 | (1) |
|
Using Generator Functions to Create Iterators |
|
|
148 | (1) |
|
Generator Functions As Methods |
|
|
149 | (1) |
|
Using a Generator Directly |
|
|
150 | (1) |
|
Consuming Values with Generators |
|
|
151 | (4) |
|
Using return in a Generator Function |
|
|
155 | (1) |
|
Precedence of the yield Operator |
|
|
155 | (2) |
|
The return and throw Methods: Terminating a Generator |
|
|
157 | (1) |
|
Yielding a Generator or Iterable: yield* |
|
|
158 | (5) |
|
|
163 | (2) |
|
Use Constructs That Consume Iterables |
|
|
163 | (1) |
|
Use DOM Collection Iteration Features |
|
|
163 | (1) |
|
Use the Iterable and Iterator Interfaces |
|
|
164 | (1) |
|
Use Iterable Spread Syntax in Most Places You Used to Use Function.prototype.apply |
|
|
164 | (1) |
|
|
164 | (1) |
|
|
165 | (16) |
|
|
165 | (1) |
|
Basic Object Destructuring |
|
|
166 | (3) |
|
Basic Array (and Iterable) Destructuring |
|
|
169 | (1) |
|
|
170 | (2) |
|
Rest Syntax in Destructuring Patterns |
|
|
172 | (1) |
|
|
173 | (1) |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
175 | (3) |
|
|
178 | (1) |
|
|
179 | (2) |
|
Use Destructuring When Getting Only Some Properties from an Object |
|
|
179 | (1) |
|
Use Destructuring for Options Objects |
|
|
179 | (2) |
|
|
181 | (40) |
|
|
182 | (1) |
|
|
182 | (4) |
|
|
182 | (2) |
|
|
184 | (2) |
|
|
186 | (1) |
|
Using an Existing Promise |
|
|
186 | (15) |
|
|
187 | (1) |
|
|
187 | (4) |
|
Comparison with Callbacks |
|
|
191 | (1) |
|
|
192 | (2) |
|
|
194 | (4) |
|
Throw in then, catch, and finally Handlers |
|
|
198 | (1) |
|
The then Method with Two Arguments |
|
|
199 | (2) |
|
Adding Handlers to Already Settled Promises |
|
|
201 | (1) |
|
|
202 | (5) |
|
|
203 | (2) |
|
|
205 | (1) |
|
|
206 | (1) |
|
Other Promise Utility Methods |
|
|
207 | (3) |
|
|
207 | (2) |
|
|
209 | (1) |
|
|
209 | (1) |
|
|
210 | (1) |
|
|
210 | (4) |
|
Handle Errors or Return the Promise |
|
|
210 | (1) |
|
|
211 | (2) |
|
|
213 | (1) |
|
|
214 | (4) |
|
Unnecessary new Promise(/*...*/) |
|
|
214 | (1) |
|
Not Handling Errors (or Not Properly) |
|
|
214 | (1) |
|
Letting Errors Go Unnoticed When Converting a Callback API |
|
|
214 | (1) |
|
Implicitly Converting Rejection to Fulfillment |
|
|
215 | (1) |
|
Trying to Use Results Outside the Chain |
|
|
216 | (1) |
|
Using Do-Nothing Handlers |
|
|
216 | (1) |
|
Branching the Chain Incorrectly |
|
|
217 | (1) |
|
|
218 | (1) |
|
|
219 | (2) |
|
Use Promises Instead of Success/Failure Callbacks |
|
|
219 | (2) |
|
Chapter 9 Asynchronous Functions, Iterators, And Generators |
|
|
221 | (20) |
|
|
222 | (10) |
|
Async Functions Create Promises |
|
|
224 | (1) |
|
|
225 | (1) |
|
Standard Logic Is Asynchronous When await Is Used |
|
|
225 | (2) |
|
Rejections Are Exceptions, Exceptions Are Rejections; Fulfillments Are Results, Returns Are Resolutions |
|
|
227 | (2) |
|
Parallel Operations in async Functions |
|
|
229 | (1) |
|
You Don't Need return await |
|
|
230 | (1) |
|
Pitfall: Using an async Function in an Unexpected Place |
|
|
231 | (1) |
|
Async Iterators, Iterables, and Generators |
|
|
232 | (6) |
|
|
233 | (3) |
|
|
236 | (2) |
|
|
238 | (1) |
|
|
238 | (3) |
|
Use async Functions and await Instead of Explicit Promises and then/catch |
|
|
238 | (3) |
|
Chapter 10 Templates, Tag Functions, And New String Features |
|
|
241 | (22) |
|
|
241 | (9) |
|
Basic Functionality (Untagged Template Literals) |
|
|
242 | (1) |
|
Template Tag Functions (Tagged Template Literals) |
|
|
243 | (5) |
|
|
248 | (1) |
|
Reusing Template Literals |
|
|
249 | (1) |
|
Template Literals and Automatic Semicolon Insertion |
|
|
250 | (1) |
|
|
250 | (5) |
|
Unicode, and What Is a JavaScript String? |
|
|
250 | (2) |
|
Code Point Escape Sequence |
|
|
252 | (1) |
|
|
252 | (1) |
|
String, prototype. codePointAt |
|
|
252 | (1) |
|
String.prototype.normalize |
|
|
253 | (2) |
|
|
255 | (1) |
|
|
256 | (3) |
|
|
256 | (1) |
|
String.prototype.startsWith, endsWith |
|
|
256 | (1) |
|
String.prototype.includes |
|
|
257 | (1) |
|
String.prototype.padStart, padEnd |
|
|
257 | (1) |
|
String.prototype.trimStart, trimEnd |
|
|
258 | (1) |
|
Updates to the match, split, search, and replace Methods |
|
|
259 | (1) |
|
|
260 | (3) |
|
Use Template Literals Instead of String Concatenation (Where Appropriate) |
|
|
260 | (1) |
|
Use Tag Functions and Template Literals for DSLs Instead of Custom Placeholder Mechanisms |
|
|
261 | (1) |
|
|
261 | (2) |
|
Chapter 11 New Array Features, Typed Arrays |
|
|
263 | (30) |
|
|
264 | (12) |
|
|
264 | (1) |
|
|
264 | (2) |
|
|
266 | (1) |
|
|
267 | (1) |
|
|
268 | (1) |
|
Array.prototype.copyWithin |
|
|
269 | (2) |
|
|
271 | (2) |
|
Array.prototype.findlndex |
|
|
273 | (1) |
|
|
273 | (1) |
|
Common Pitfall: Using an Object As the Fill Value |
|
|
273 | (1) |
|
|
274 | (1) |
|
|
275 | (1) |
|
|
276 | (1) |
|
Iteration, Spread, Destructuring |
|
|
276 | (1) |
|
|
276 | (1) |
|
|
277 | (15) |
|
|
277 | (2) |
|
|
279 | (1) |
|
|
280 | (2) |
|
ArrayBuffer: The Storage Used by Typed Arrays |
|
|
282 | (2) |
|
|
284 | (2) |
|
DataView: Raw Access to the Buffer |
|
|
286 | (1) |
|
Sharing an ArrayBuffer Between Arrays |
|
|
287 | (1) |
|
|
287 | (1) |
|
|
288 | (1) |
|
|
289 | (1) |
|
|
289 | (1) |
|
|
289 | (1) |
|
%TypedArray%.prototype.set |
|
|
290 | (1) |
|
%TypedArray%.prototype.subarray |
|
|
291 | (1) |
|
|
292 | (1) |
|
Use find and find Index to Search Arrays Instead of Loops (Where Appropriate) |
|
|
292 | (1) |
|
Use Array.fill to Fill Arrays Rather Than Loops |
|
|
292 | (1) |
|
Use readAsArrayBuffer Instead of readAsBinaryString |
|
|
292 | (1) |
|
|
293 | (26) |
|
|
293 | (7) |
|
|
294 | (2) |
|
|
296 | (1) |
|
Creating Maps from Iterables |
|
|
297 | (1) |
|
Iterating the Map Contents |
|
|
297 | (2) |
|
|
299 | (1) |
|
|
300 | (1) |
|
|
300 | (4) |
|
|
301 | (1) |
|
Creating Sets from Iterables |
|
|
302 | (1) |
|
Iterating the Set Contents |
|
|
302 | (1) |
|
|
303 | (1) |
|
|
304 | (1) |
|
|
304 | (10) |
|
WeakMaps Are Not Iterable |
|
|
305 | (1) |
|
|
305 | (1) |
|
Use Case: Private Information |
|
|
305 | (2) |
|
Use Case: Storing Information for Objects Outside Your Control |
|
|
307 | (1) |
|
Values Referring Back to the Key |
|
|
308 | (6) |
|
|
314 | (2) |
|
|
314 | (1) |
|
|
315 | (1) |
|
|
316 | (3) |
|
Use Maps Instead of Objects for General-Purpose Maps |
|
|
316 | (1) |
|
Use Sets Instead of Objects for Sets |
|
|
316 | (1) |
|
Use WeakMaps for Storing Private Data Instead of Public Properties |
|
|
317 | (2) |
|
|
319 | (46) |
|
|
319 | (1) |
|
|
320 | (11) |
|
|
322 | (1) |
|
|
322 | (2) |
|
|
324 | (1) |
|
Using Modules in Browsers |
|
|
325 | (1) |
|
Module Scripts Don't Delay Parsing |
|
|
326 | (1) |
|
|
327 | (1) |
|
Module Specifiers on the Web |
|
|
328 | (1) |
|
|
328 | (2) |
|
Module Specifiers in Node.js |
|
|
330 | (1) |
|
Node.js is Adding More Module Features |
|
|
331 | (1) |
|
|
331 | (1) |
|
Re-Exporting Exports from Another Module |
|
|
332 | (1) |
|
|
333 | (1) |
|
Importing a Module's Namespace Object |
|
|
333 | (1) |
|
Exporting Another Module's Namespace Object |
|
|
334 | (1) |
|
Importing a Module Just for Side Effects |
|
|
335 | (1) |
|
Import and Export Entries |
|
|
335 | (3) |
|
|
335 | (1) |
|
|
336 | (2) |
|
Imports Are Live and Read-Only |
|
|
338 | (2) |
|
Module Instances Are Realm-Specific |
|
|
340 | (1) |
|
|
341 | (7) |
|
|
342 | (2) |
|
|
344 | (2) |
|
|
346 | (1) |
|
Temporal Dead Zone (TDZ) Review |
|
|
346 | (1) |
|
Cyclic Dependencies and the TDZ |
|
|
347 | (1) |
|
Import/Export Syntax Review |
|
|
348 | (2) |
|
|
348 | (2) |
|
|
350 | (1) |
|
|
350 | (7) |
|
Importing a Module Dynamically |
|
|
351 | (1) |
|
|
352 | (4) |
|
Dynamic Import in Non-Module Scripts |
|
|
356 | (1) |
|
|
357 | (2) |
|
|
359 | (1) |
|
|
360 | (1) |
|
|
360 | (2) |
|
Loading a Web Worker as a Module |
|
|
360 | (1) |
|
Loading a Node.js Worker as a Module |
|
|
361 | (1) |
|
A Worker Is in Its Own Realm |
|
|
361 | (1) |
|
|
362 | (3) |
|
Use Modules Instead of Pseudo-Namespaces |
|
|
362 | (1) |
|
Use Modules Instead of Wrapping Code in Scoping Functions |
|
|
363 | (1) |
|
Use Modules to Avoid Creating Megalithic Code Files |
|
|
363 | (1) |
|
Convert CJS, AMD, and Other Modules to ESM |
|
|
363 | (1) |
|
Use a Well-Maintained Bundler Rather Than Going Homebrew |
|
|
363 | (2) |
|
Chapter 14 Reflection---Reflect And Proxy |
|
|
365 | (32) |
|
|
365 | (6) |
|
|
367 | (1) |
|
|
367 | (1) |
|
|
368 | (1) |
|
|
369 | (1) |
|
|
370 | (1) |
|
|
371 | (24) |
|
|
373 | (8) |
|
|
381 | (1) |
|
|
381 | (1) |
|
|
381 | (1) |
|
|
382 | (1) |
|
|
382 | (2) |
|
|
384 | (1) |
|
|
385 | (1) |
|
The getOwnPropertyDescriptor Trap |
|
|
386 | (1) |
|
|
387 | (1) |
|
|
388 | (1) |
|
|
388 | (1) |
|
|
388 | (1) |
|
The preventExtensions Trap |
|
|
389 | (1) |
|
|
389 | (1) |
|
|
390 | (1) |
|
Example: Hiding Properties |
|
|
391 | (3) |
|
|
394 | (1) |
|
|
395 | (2) |
|
Use Proxies Rather Than Relying on Consumer Code Not to Modify API Objects |
|
|
395 | (1) |
|
Use Proxies to Separate Implementation Code from Instrumenting Code |
|
|
395 | (2) |
|
Chapter 15 Regular Expression Updates |
|
|
397 | (20) |
|
|
398 | (1) |
|
|
398 | (2) |
|
|
398 | (1) |
|
|
399 | (1) |
|
|
400 | (1) |
|
|
400 | (5) |
|
|
400 | (4) |
|
|
404 | (1) |
|
|
405 | (1) |
|
|
405 | (3) |
|
|
405 | (1) |
|
|
406 | (1) |
|
Greediness Is Right-to-Left in Lookbehinds |
|
|
407 | (1) |
|
Capture Group Numbering and References |
|
|
407 | (1) |
|
|
408 | (5) |
|
|
408 | (1) |
|
|
409 | (4) |
|
|
413 | (4) |
|
Use the Sticky Flag (y) Instead of Creating Substrings and Using & When Parsing |
|
|
413 | (1) |
|
Use the Dot All Flag (s) Instead of Using Workarounds to Match All Characters (Including Line Breaks) |
|
|
414 | (1) |
|
Use Named Capture Groups Instead of Anonymous Ones |
|
|
414 | (1) |
|
Use Lookbehinds Instead of Various Workarounds |
|
|
415 | (1) |
|
Use Code Point Escapes Instead of Surrogate Pairs in Regular Expressions |
|
|
415 | (1) |
|
Use Unicode Patterns Instead of Workarounds |
|
|
415 | (2) |
|
|
417 | (44) |
|
|
417 | (1) |
|
|
418 | (1) |
|
|
418 | (2) |
|
|
420 | (6) |
|
Critical Sections, Locks, and Condition Variables |
|
|
420 | (2) |
|
|
422 | (4) |
|
Memory Is Shared, Not Objects |
|
|
426 | (1) |
|
Race Conditions, Out-of-Order Stores, Stale Values, Tearing, and More |
|
|
427 | (2) |
|
|
429 | (5) |
|
Low-Level Atomics Features |
|
|
432 | (1) |
|
Using Atomics to Suspend and Resume Threads |
|
|
433 | (1) |
|
|
434 | (21) |
|
Here There Be Dragons! (Again) |
|
|
455 | (5) |
|
|
460 | (1) |
|
Use Shared Blocks Rather Than Exchanging Large Data Blocks Repeatedly |
|
|
460 | (1) |
|
Use Atomics.wait and Atomics.notify Instead of Breaking Up Worker Jobs to Support the Event Loop (Where Appropriate) |
|
|
460 | (1) |
|
|
461 | (32) |
|
|
462 | (3) |
|
|
462 | (1) |
|
Explicit and Implicit Conversion |
|
|
463 | (1) |
|
|
464 | (1) |
|
Biglnt64Array and BigUint64Array |
|
|
465 | (1) |
|
|
465 | (1) |
|
|
465 | (2) |
|
|
465 | (1) |
|
Octal Integer Literals, Take II |
|
|
466 | (1) |
|
|
467 | (1) |
|
|
467 | (1) |
|
Low-Level Math Support Functions |
|
|
468 | (1) |
|
|
468 | (2) |
|
Date.prototype.toString Change |
|
|
470 | (1) |
|
Function.prototype.toString Change |
|
|
471 | (1) |
|
|
471 | (3) |
|
|
471 | (1) |
|
Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER |
|
|
472 | (1) |
|
|
472 | (1) |
|
|
473 | (1) |
|
Number.isFinite, Number.isNaN |
|
|
473 | (1) |
|
Number.parseInt, Number.parseFloat |
|
|
473 | (1) |
|
|
473 | (1) |
|
Symbol.isConcatSpreadable |
|
|
474 | (1) |
|
|
475 | (4) |
|
|
475 | (1) |
|
|
476 | (2) |
|
|
478 | (1) |
|
Unicode Line Breaks in JSON |
|
|
478 | (1) |
|
Well-Formed JSON from JSON.stringify |
|
|
479 | (1) |
|
Various Standard Library / Global Additions |
|
|
479 | (3) |
|
|
479 | (1) |
|
|
479 | (1) |
|
|
480 | (1) |
|
Symbol description Property |
|
|
481 | (1) |
|
String.prototype.matchAII |
|
|
481 | (1) |
|
Annex B: Browser-Only Features |
|
|
482 | (6) |
|
|
483 | (1) |
|
Regular Expression Tweaks |
|
|
483 | (1) |
|
Control Character Escape (\cX) Extension |
|
|
483 | (1) |
|
Tolerating Invalid Sequences |
|
|
484 | (1) |
|
|
484 | (1) |
|
Additional Built-In Properties |
|
|
484 | (1) |
|
Additional Object Properties |
|
|
484 | (1) |
|
Additional String Methods |
|
|
485 | (1) |
|
Various Bits of Loosened or Obscure Syntax |
|
|
486 | (1) |
|
When document.all Isn't There ... or Is It? |
|
|
487 | (1) |
|
|
488 | (3) |
|
|
491 | (2) |
|
|
491 | (1) |
|
Use New Math Functions Instead of Various Math Workarounds |
|
|
491 | (1) |
|
Use Nullish Coalescing for Defaults |
|
|
491 | (1) |
|
Use Optional Chaining Instead of & Checks |
|
|
491 | (1) |
|
Leave the Error Binding (e) Off of "catch (e)" When Not Using It |
|
|
492 | (1) |
|
Use the Exponentiation Operator Rather Than Math.pow |
|
|
492 | (1) |
|
Chapter 18 Upcoming Class Features |
|
|
493 | (24) |
|
Public and Private Class Fields, Methods, and Accessors |
|
|
493 | (21) |
|
Public Field (Property) Definitions |
|
|
494 | (5) |
|
|
499 | (8) |
|
Private Instance Methods and Accessors |
|
|
507 | (1) |
|
|
507 | (4) |
|
|
511 | (1) |
|
Public Static Fields, Private Static Fields, and Private Static Methods |
|
|
511 | (1) |
|
|
511 | (2) |
|
|
513 | (1) |
|
|
513 | (1) |
|
|
514 | (3) |
|
Use Property Definitions Instead of Creating Properties in the Constructor (Where Appropriate) |
|
|
514 | (1) |
|
Use Private Fields Instead of Prefixes (Where Appropriate) |
|
|
514 | (1) |
|
Use Private Methods Instead of Functions Outside the Class for Private Operations |
|
|
514 | (3) |
|
Chapter 19 A Look Ahead ... |
|
|
517 | (22) |
|
|
518 | (7) |
|
|
518 | (2) |
|
|
520 | (4) |
|
|
524 | (1) |
|
WeakRefs and Cleanup Callbacks |
|
|
525 | (8) |
|
|
525 | (3) |
|
|
528 | (5) |
|
|
533 | (2) |
|
String.prototype.replaceAII |
|
|
535 | (1) |
|
|
535 | (1) |
|
|
536 | (1) |
|
|
536 | (1) |
|
|
537 | (1) |
|
Legacy Deprecated RegExp Features |
|
|
537 | (1) |
|
|
538 | (1) |
Appendix: Fantastic Features And Where To Find Them |
|
539 | (18) |
Index |
|
557 | |