- What is
ES6
?
- Officially ECMAScript 6, it is the most recent build of syntax for JavaScript (ECMAScript is the 'proper' name for JavaScript).
- What is Transpilation and how does it relate to
ES6
?
- A source-to-source compiler. With regard to
ES6
, a tool like Babel would allow you to write inES6
and have the code compiled toES5
, for environments whereES6
might not yet be supported.
- Looking at the ES6 features link below, discuss one update from
ES5
and if it seems useful/superfluous.
- I had seen the new 'arrow' syntax but didn't have an understanding of it. In short, it is shorthand for
function
and is of particular use when a single-line function is being called. From the examples found here:
var bar = foo.map(function(x) { return x.length; });
becomes:
let bar = foo.map(x => x.length);
In addition to the function call no longer being spelled out explicitly with function
, return
is implicit.