Exploring ES2016 and ES2017
Homepage
Please support this book: buy it (PDF, EPUB, MOBI) or donate
(Ad, please don’t block.)

Table of contents

    1. What you need to know about this book
      1. What is in this book?
      2. Support
    2. About the author
  1. I Background
    1. 1. The TC39 process for ECMAScript features
      1. 1.1 Who designs ECMAScript?
      2. 1.2 How is ECMAScript designed?
        1. 1.2.1 Problem: ECMAScript 2015 (ES6) was too large a release
        2. 1.2.2 Solution: the TC39 process
      3. 1.3 Don’t call them ECMAScript 20xx features
      4. 1.4 Further reading
    2. 2. FAQ: ES2016 and ES2017
      1. 2.1 Isn’t ECMAScript 2016 too small?
  2. II ECMAScript 2016
    1. 3. The exponentiation operator (**)
      1. 3.1 Overview
      2. 3.2 An infix operator for exponentiation
    2. 4. ES2016 feature: Array.prototype.includes
      1. 4.1 Overview
      2. 4.2 The Array method includes
      3. 4.3 Frequently asked questions
      4. 4.4 Further reading
  3. III ECMAScript 2017
    1. 5. ES proposal: Object.entries() and Object.values()
      1. 5.1 Overview
        1. 5.1.1 Object.entries()
        2. 5.1.2 Object.values()
      2. 5.2 Object.entries()
        1. 5.2.1 Setting up Maps via Object.entries()
        2. 5.2.2 FAQ: Object.entries()
      3. 5.3 Object.values()
    2. 6. New string methods: padStart and padEnd
      1. 6.1 Overview
      2. 6.2 Why pad strings?
      3. 6.3 String.prototype.padStart(maxLength, fillString=' ')
        1. 6.3.1 A simple implementation of padStart()
      4. 6.4 String.prototype.padEnd(maxLength, fillString=' ')
      5. 6.5 FAQ: padStart and padEnd
        1. 6.5.1 Why aren’t the padding methods called padLeft and padRight?
    3. 7. Object.getOwnPropertyDescriptors()
      1. 7.1 Overview
      2. 7.2 Object.getOwnPropertyDescriptors()
      3. 7.3 Use cases for Object.getOwnPropertyDescriptors()
        1. 7.3.1 Use case: copying properties into an object
        2. 7.3.2 Use case: cloning objects
        3. 7.3.3 Use case: cross-platform object literals with arbitrary prototypes
      4. 7.4 Pitfall: copying methods that use super
    4. 8. Trailing commas in function parameter lists and calls
      1. 8.1 Overview
      2. 8.2 Trailing commas in object literals and Array literals
      3. 8.3 Feature: allow trailing commas in parameter definitions and function calls
    5. 9. Async functions
      1. 9.1 Overview
        1. 9.1.1 Variants
        2. 9.1.2 Async functions always return Promises
        3. 9.1.3 Handling results and errors of asynchronous computations via await
      2. 9.2 Understanding async functions
        1. 9.2.1 Writing asynchronous code via generators
        2. 9.2.2 Writing asynchronous code via async functions
        3. 9.2.3 Async functions are started synchronously, settled asynchronously
        4. 9.2.4 Returned Promises are not wrapped
      3. 9.3 Tips for using await
        1. 9.3.1 Don’t forget await
        2. 9.3.2 You don’t need await if you “fire and forget”
        3. 9.3.3 await is sequential, Promise.all() is parallel
      4. 9.4 Async functions and callbacks
        1. 9.4.1 Array.prototype.map()
        2. 9.4.2 Array.prototype.forEach()
      5. 9.5 Tips for using async functions
        1. 9.5.1 Know your Promises
        2. 9.5.2 Immediately Invoked Async Function Expressions
        3. 9.5.3 Unit testing with async functions
        4. 9.5.4 Don’t worry about unhandled rejections
      6. 9.6 Further reading
© 2016 Axel Rauschmayer (cover by Fran Caye)