Exploring ES2016 and ES2017
Exploring ES2016 and ES2017
About the Book
- Complete contents of this book: http://exploringjs.com/es2016-es2017/
- Homepage with various resources: http://exploringjs.com/es2016-es2017.html
Bundles that include this book
Table of Contents
-
-
What you need to know about this book
- Support
- About the author
-
What you need to know about this book
-
I Background
-
1. The TC39 process for ECMAScript features
- 1.1 Who designs ECMAScript?
-
1.2 How is ECMAScript designed?
- 1.2.1 Problem: ECMAScript 2015 (ES6) was too large a release
- 1.2.2 Solution: the TC39 process
- 1.3 Don’t call them ECMAScript 20xx features
- 1.4 Further reading
-
2. FAQ: ES2016 and ES2017
- 2.1 Isn’t ECMAScript 2016 too small?
-
1. The TC39 process for ECMAScript features
-
II ECMAScript 2016
-
3.
Array.prototype.includes
- 3.1 Overview
-
3.2 The Array method
includes
- 3.3 Frequently asked questions
- 3.4 Further reading
-
4. Exponentiation operator (
**
)- 4.1 Overview
- 4.2 An infix operator for exponentiation
- 4.3 Examples
- 4.4 Precedence
- 4.5 Further reading
-
3.
-
III ECMAScript 2017
-
5. Async functions
-
5.1 Overview
- 5.1.1 Variants
- 5.1.2 Async functions always return Promises
-
5.1.3 Handling results and errors of asynchronous computations via
await
-
5.2 Understanding async functions
- 5.2.1 Writing asynchronous code via generators
- 5.2.2 Writing asynchronous code via async functions
- 5.2.3 Async functions are started synchronously, settled asynchronously
- 5.2.4 Returned Promises are not wrapped
-
5.3 Tips for using
await
-
5.3.1 Don’t forget
await
-
5.3.2 You don’t need
await
if you “fire and forget” -
5.3.3
await
is sequential,Promise.all()
is parallel
-
5.3.1 Don’t forget
-
5.4 Async functions and callbacks
-
5.4.1
Array.prototype.map()
-
5.4.2
Array.prototype.forEach()
-
5.4.1
-
5.5 Tips for using async functions
- 5.5.1 Know your Promises
- 5.5.2 Immediately Invoked Async Function Expressions
- 5.5.3 Unit testing with async functions
- 5.5.4 Don’t worry about unhandled rejections
- 5.6 Further reading
-
5.1 Overview
-
6. Shared memory and atomics
-
6.1 Parallelism vs. concurrency
- 6.1.1 Models of parallelism
-
6.2 A history of JS parallelism
-
6.2.1 The next step:
SharedArrayBuffer
-
6.2.1 The next step:
-
6.3 Shared Array Buffers
- 6.3.1 Creating and sending a Shared Array Buffer
- 6.3.2 Receiving a Shared Array Buffer
-
6.4 Atomics: safely accessing shared data
- 6.4.1 Problem: Optimizations make code unpredictable across workers
- 6.4.2 Solution: atomics
- 6.4.3 Problem: torn values
-
6.5 Shared Array Buffers in use
- 6.5.1 Shared Array Buffers and the run-to-completion semantics of JavaScript
- 6.5.2 Shared Array Buffers and asm.js and WebAssembly
- 6.5.3 Sharing data other than integers
- 6.5.4 How much faster is code that uses Shared Array Buffers?
-
6.6 Example
- 6.6.1 Using a shared lock
- 6.6.2 Implementing a shared lock
- 6.6.3 Conclusion for the example
-
6.7 The API for shared memory and atomics
-
6.7.1
SharedArrayBuffer
-
6.7.2
Atomics
-
6.7.1
-
6.8 FAQ
- 6.8.1 What browsers support Shared Array Buffers?
- 6.9 Further reading
-
6.1 Parallelism vs. concurrency
-
7.
Object.entries()
andObject.values()
-
7.1 Overview
-
7.1.1
Object.entries()
-
7.1.2
Object.values()
-
7.1.1
-
7.2
Object.entries()
-
7.2.1 Setting up Maps via
Object.entries()
-
7.2.2 FAQ:
Object.entries()
-
7.2.1 Setting up Maps via
-
7.3
Object.values()
-
7.1 Overview
-
8. New string methods:
padStart
andpadEnd
- 8.1 Overview
- 8.2 Why pad strings?
-
8.3
String.prototype.padStart(maxLength, fillString=' ')
-
8.3.1 A simple implementation of
padStart()
-
8.3.1 A simple implementation of
-
8.4
String.prototype.padEnd(maxLength, fillString=' ')
-
8.5 FAQ:
padStart
andpadEnd
-
8.5.1 Why aren’t the padding methods called
padLeft
andpadRight
?
-
8.5.1 Why aren’t the padding methods called
-
9.
Object.getOwnPropertyDescriptors()
- 9.1 Overview
-
9.2
Object.getOwnPropertyDescriptors()
-
9.3 Use cases for
Object.getOwnPropertyDescriptors()
- 9.3.1 Use case: copying properties into an object
- 9.3.2 Use case: cloning objects
- 9.3.3 Use case: cross-platform object literals with arbitrary prototypes
-
9.4 Pitfall: copying methods that use
super
-
10. Trailing commas in function parameter lists and calls
- 10.1 Overview
- 10.2 Trailing commas in object literals and Array literals
- 10.3 Feature: allow trailing commas in parameter definitions and function calls
-
5. Async functions
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them