Appendix A. An overview of ECMAScript 6

 

ECMAScript is a standard for client-side scripting languages. The first edition of the ECMAScript specification was released in 1997, and the sixth edition was finalized in 2015. The seventh edition is already in the works. The ECMAScript standard is implemented in several languages, and the most popular implementation is JavaScript. In this appendix, we’ll look at the JavaScript implementation of ECMAScript 6 (ES6), also known as ECMAScript 2015.

At the time of writing, not all web browsers fully support the ES6 specification; you can visit the ECMAScript compatibility site at http://mng.bz/ao59 to see the current state of ES6 support. The good news is that you can and should develop in ES6 today and use a transpiler like Traceur (https://github.com/google/traceur-compiler) or Babel (https://babeljs.io) to turn the ES6 code into an ES5 version supported by all web browsers.

Note

If you’d like to test your ES6 code in upcoming versions of popular web browsers, download the latest nightly build of Firefox at https://nightly.mozilla.org or use the remote version of Internet Explorer at https://remote.modern.ie. You can also get the Canary build of Chrome at http://mng.bz/9rub. You may need to enable experimental JavaScript features by visiting the URL chrome://flags (for Chrome) or about://flags (for IE).

A.1. How to run the code samples

A.2. Template literals

A.3. Optional parameters and default values

A.4. Scope of variables

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

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

A.7. Classes and inheritance

A.8. Asynchronous processing with promises

A.9. Modules

sitemap