Browser and Node.js Compatibility
Emerging Best Practices for Block Bindings
2
STRINGS AND REGULAR EXPRESSIONS
The String.fromCodePoint() Method
Methods for Identifying Substrings
Other Regular Expression Changes
Duplicating Regular Expressions
Functions with Default Parameter Values
Simulating Default Parameter Values in ECMAScript 5
Default Parameter Values in ECMAScript 6
How Default Parameter Values Affect the arguments Object
Working with Unnamed Parameters
Unnamed Parameters in ECMAScript 5
Increased Capabilities of the Function Constructor
Special Cases of the name Property
Clarifying the Dual Purpose of Functions
Determining How a Function Was Called in ECMAScript 5
Deciding When to Use Block-Level Functions
Block-Level Functions in Non-Strict Mode
Creating Immediately Invoked Function Expressions
How Tail Calls Are Different in ECMAScript 6
How to Harness Tail Call Optimization
4
EXPANDED OBJECT FUNCTIONALITY
Object Literal Syntax Extensions
Property Initializer Shorthand
Duplicate Object Literal Properties
Own Property Enumeration Order
Changing an Object’s Prototype
Easy Prototype Access with Super References
5
DESTRUCTURING FOR EASIER DATA ACCESS
Assigning to Different Local Variable Names
Destructured Parameters Are Required
Default Values for Destructured Parameters
6
SYMBOLS AND SYMBOL PROPERTIES
Exposing Internal Operations with Well-Known Symbols
The Symbol.isConcatSpreadable Property
The Symbol.match, Symbol.replace, Symbol.search, and Symbol.split Properties
The Symbol.toStringTag Property
The Symbol.unscopables Property
Creating Sets and Adding Items
Generator Function Expressions
Accessing the Default Iterator
The Spread Operator and Nonarray Iterables
Advanced Iterator Functionality
Passing Arguments to Iterators
9
INTRODUCING JAVASCRIPT CLASSES
Class-Like Structures in ECMAScript 5
Classes as First-Class Citizens
Inheritance with Derived Classes
Derived Classes from Expressions
Using new.target in Class Constructors
The find() and findIndex() Methods
Manipulating Array Buffers with Views
Similarities Between Typed and Regular Arrays
Differences Between Typed and Regular Arrays
11
PROMISES AND ASYNCHRONOUS PROGRAMMING
Asynchronous Programming Background
Global Promise Rejection Handling
Returning Values in Promise Chains
Returning Promises in Promise Chains
Responding to Multiple Promises
Promise-Based Asynchronous Task Running
12
PROXIES AND THE REFLECTION API
Introducing Proxies and Reflection
Validating Properties Using the set Trap
Object Shape Validation Using the get Trap
Hiding Property Existence Using the has Trap
Preventing Property Deletion with the deleteProperty Trap
How Prototype Proxy Traps Work
Duplicate Extensibility Methods
Blocking Object.defineProperty()
Descriptor Object Restrictions
Function Proxies with the apply and construct Traps
Validating Function Parameters
Calling Constructors Without new
Overriding Abstract Base Class Constructors
Increasing length When Adding New Elements
Deleting Elements When Reducing length
Implementing the MyArray Class
Using the get Trap on a Prototype
Using the set Trap on a Prototype
Using the has Trap on a Prototype
Proxies as Prototypes on Classes
13
ENCAPSULATING CODE WITH MODULES
A Subtle Quirk of Imported Bindings
Browser Module Specifier Resolution
A
MINOR CHANGES IN ECMASCRIPT 6
Formalizing the __proto__ Property
B
UNDERSTANDING ECMASCRIPT 7 (2016)
The Array.prototype.includes() Method
How to Use Array.prototype.includes()