Blog of Raivo Laanemets

Stories about web development, consulting and personal computers.

ECMAScript 6

On 2015-06-25

ECMAScript 6 specification has been approved by ECMA International. The spec brings lots of new features into the JavaScript language. Hopefully it will be adopted fast by JavaScript engines.

Some new features:

  • classes
  • destructuring
  • arrow functions (lexical this)
  • generators
  • tail calls
  • block-scoped let
  • const
  • Promise built-in
  • Symbol built-in
  • Map and Set built-ins
  • Proxy built-in
  • etc...

The spec can be read online here. The current compatibility list can be found from here. ES6 code can be transpiled for current runtimes by using the Babel compiler. Many ES6 features have been covered in-depth in the ②ality blog.

Out of the new features I really like Promises. Large part of my JavaScript code runs on server-side, with Node.js, and interacts with databases and other external sources of data. This means high number of async operations. Promises make it easy to compose async operations. They are shimmable to old runtimes and I have been using them for 2 years already. It's good to see that they are now part of the language specification. While other updates are nice too, they are unlikely to bring as much productivity boost as Promises.