Understanding ECMAScript6

Understanding ECMAScript 6

The Definitive Guide for JavaScript Developers
by Nicholas C. Zakas
August 2016, 352 pp.
ISBN-13: 
978-1-59327-757-4

ECMAScript 6 represents the biggest update to the core of JavaScript in the history of the language. In Understanding ECMAScript 6, expert developer Nicholas C. Zakas provides a complete guide to the object types, syntax, and other exciting changes that ECMAScript 6 brings to JavaScript. Every chapter is packed with example code that works in any JavaScript environment so you’ll be able to see new features in action. You’ll learn:

  • How ECMAScript 6 class syntax relates to more familiar JavaScript concepts
  • What makes iterators and generators useful
  • How arrow functions differ from regular functions
  • Ways to store data with sets, maps, and more
  • The power of inheritance
  • How to improve asynchronous programming with promises
  • How modules change the way you organize code

Whether you’re a web developer or a Node.js developer, you’ll find Understanding ECMAScript 6 indispensable on your journey from ECMAScript 5 to ECMAScript 6.

Author Bio 

Nicholas C. Zakas has been working on web applications since 2000, focusing on frontend development, and is known for writing and speaking about frontend best practices. He honed his experience during his five years at Yahoo!, where he was principal frontend engineer for the Yahoo! home page. He is the author of several books, including The Principles of Object-Oriented JavaScript (No Starch Press) and Professional JavaScript for Web Developers (Wrox).

Table of contents 

Introduction
Chapter 1: Block Bindings
Chapter 2: Strings and Regular Expressions
Chapter 3: Functions
Chapter 4: Expanded Object Functionality
Chapter 5: Destructuring for Easier Data Access
Chapter 6: Symbols and Symbol Properties
Chapter 7: Sets and Maps
Chapter 8: Iterators and Generators
Chapter 9: Introducing JavaScript Classes
Chapter 10: Improved Array Capabilities
Chapter 11: Promises and Asynchronous Programming
Chapter 12: Proxies and the Reflection API
Chapter 13: Encapsulating Code with Modules

Appendix A: Minor Changes in ECMAScript 6
Appendix B: Understanding ECMAScript 7 (2016)

View the detailed Table of Contents (PDF)
View the Index (PDF)

Reviews 

“Recommended to any JavaScript user looking to grok ES6.”
—The MagPi (Read More)

“This book is for existing JavaScript coders who want to keep their skills sharp.”
—Network Security

Understanding ECMAScript 6 is now essential for all web developers. This book will help you get started.”
—Modelus (Read More)

Updates 

Page 20: The line that reads:
The call to msg.endsWith("o", 8) starts the search
from index 0 and searches up to index 7, which is the o in world.

Should read:
The call to msg.endsWith("o", 8) starts the search
from index 7 (the second argument minus the length of the first argument), which is the o in world.

Page 25: The ECMAScript wiki weblink in the first paragrah under "Template Literals" should be: https://web.archive.org/web/20170114115928/http://wiki.ecmascript.org/doku.php?id=harmony:quasis

Page 77: The phrase "in ECMAScript 5" should be removed from the following sentence:

"For example, to override a method on an object instance so it also calls the prototype method of the same name, you’d do the following in ECMAScript 5:"

Page 136: In the summary, it says sets and maps are "unordered", but it should actually say sets and maps are "ordered."

Page 143: The line that reads: A for-of loop calls next() on an iterable each time the loop executes and stores the value from the result object in a variable.

Should read:
A for-of loop works on an iterable and uses its Symbol.iterator property to retrieve an iterator. Then, the for-of loop calls next() on that iterator each time the loop executes and stores the value from the result object in a variable.

Page 150: The two instances of "double-byte" in the first and second paragraphs should instead say "surrogate pair".

The two instances of "Unicode" in the second and last paragraphs should instead say "surrogate pair".

Page 151: In the last paragraph, the third sentence says that “All values are read from the iterator and inserted into the array in the order in which values where returned from the iterator.” It should read “All values are read from the iterator and inserted into the array in the order in which values were returned from the iterator.”

Page 166: The line that reads: In this code, PersonType is a constructor function that creates a single property called name.

Should read: The line that reads: In this code, PersonType is a constructor function that creates an instance with a single property called name.

Page 173: "innerHTML method" in the second paragraph should be "innerHTML principle"

Page 185: The last line that reads:
Behind the scenes, the Symbol.species property is actually making this change.

Should be: However, the constructor for the return value is read from, the Symbol.species property, allowing for this change.

Page 220: There is a missing semicolon in the code. Changes are marked with #Changed below:

setTimeout(function() {
console.log("Timeout");
+}, 500); #Changed

console.log("Hi!");