Appendix A. An overview of ECMAScript


ECMAScript is a standard for scripting languages. ECMAScript syntax is implemented in several languages, the most popular implementation being JavaScript. The first edition of the ECMAScript specification was released in 1997, and the sixth edition was finalized in 2015. This edition is known as ES6 or ES2015. Lots of new features were introduced in ES6 compared to its predecessor ES5, and most of the syntax covered in this appendix is about the ES6 syntax. ES7 was finalized in 2016, and ES8 in 2017. ES7 and ES8 didn’t introduce many new syntax elements, but we’ll cover the async/await syntax from ES8 at the end of this appendix.

At the time of writing, most web browsers fully support the ES6 specification, which introduced the most significant syntax additions. You can visit the ECMAScript compatibility site at to see the current state of ES6 support. Even if the users of your app have older browsers, you can develop in ES6/7/8 today and use transpilers like Traceur, Babel, or TypeScript to turn code that uses the latest syntax into its ES5 version.

A.1. How to run the code samples

A.2. Scope of variables and this

A.3. Template literals

A.4. Optional parameters and default values

A.5. Arrow function expressions, this, and that

A.6. The rest operator

A.7. The spread operator

A.8. Generator functions

A.9. Destructuring

A.10. Iterating with forEach(), for-in, and for-of

A.11. Classes and inheritance

A.12. Asynchronous processing

A.13. ES6 modules