Learning ECMAScript 6 features in Node.js console

This article offers a list of code examples to experience and learn new ECMAScript 6 features. You will get effective code snippets that simply work out of the box in the Node.js console.

The new official specification of Javascript is the ECMAScript 6 as of the ratification in June 2015. It introduces major features, thus making Javascript a much more powerful and complete language for programming the web.

While ECMAScript 6 implementation is currently underway in major Javascript engines, as of the time of writing, Node.js console supports ECMAScript 6 and 7 through the amazing Babel.js compiler. Babel.js is still under active development and some limits applies to the features available.

To start learning and getting practiced with the new Javascript, you can follow the excellent "Learn ES2015" article at Babel.js.

Here follows a table with brief explanations and examples related to new or upcoming ECMAScript features (the examples are taken from Luke Hoban's excellent es6features repository with some changes to make them work).