Chris J. Lee

Dallas Drupal Developer

You are here

What's new in Javascript ES6

What is new in Javascript ES6? There are lots of new and exciting features that will allow JavaScript really mature as a language. I've outline some. This document will evolve and update as I find more about ES6.

The new arrow function

The arrow function allows one to do the following:

// > ES6
function (x) { return x + 1 }
// ES6
x => x+1;

// > ES6   

function (x,y) { return xy; } // ES6 (x,y) => xy;

Regarding some technical details, the arrow function lack any internal prototype and construct method.

Let keyword

The new let keyword allows one to change the scope of the variable. In javascript, variables are bound by functional scope. With the let keyword, the variable is quickly garbage collected after the end of the block of code. The block is defined by the two {} parentheses.


Resources


Photo by Dmitry Baranovskiy

© 2017 Chris J. Lee