ECMAScript 6 New Features

As I was interested to discover what ECMAScript 6 will bring to what we usually refer to as simply JavaScript, I found Dr. Alex  Rauschmayer’s (@rauschma) presentation held at the Frontendconf in Zurich in August 2014:

He presented the ECMAScript 6 in a very clear and concise manner and detailed posts on each new feature, could be found on his personal blog. I would highly recommend you watch this video too if you’re interested in the progress JavaScript will make. It was indeed 2014’s most popular programming language.

To sum up in a few points, here is what the new standard will bring to the language in order to support complex applications. We all know that JavaScript/ECMAScript was not initially created to support everything that it is now used for.

Variables and Scoping

  • Blocked scope variables
  • Destructuring for objects and arrays
  • Property value shorthand for object literals
  • Multiple return values

Parameter Handling

  • Parameter default values
  • Rest parameters
  • Spread operator (…)
  • Named parameters

Arrow Functions

  • Lexical “this”, no more “that=this”

Object-orientation and Modularity

  • Classes and sub-classes
  • Modules

Template Strings

  • String interpolation
  • Raw strings

Standard Library

  • Maps
  • Sets
  • Object.assign
  • New String methods (e.g. .startsWith(string x))
  • New Array methods (e.g. find(condition))

Loops and Iteration

  • For-of loop for arrays

ECMAScript will have its formal publication in June 2015. In my next blog post I would like to cover the supersets created by Microsoft, Facebook and Google in order to create statically typed JavaScript.