ES6
Iterators
- for...in: for Objects
- for...of: Arrays and other data
- Supports break;continue;
Modules
- export any top-level function, class, var, let, or const
- import too!
let and const
- let: 'the new var', block level not function level
- const: define at initialization, can't modify
yield / generators
- towards async/await ES7
- we use https://github.com/tj/co
- non-blocking code in a nice way
template strings
- just easier
arrow functions
- shorter
- changes this: block rather than function scoped
deconstruction
- easy way to do assignment from objects
var o = {p: 42, q: true};
var {p, q} = o;
console.log(p); // 42
console.log(q); // true
other things
- classes
- sets
you can do it too!
- transpiler: babel
- optimise: https://github.com/sky-uk/hodor/blob/master/.babelrc
- build tool: broccoli
- nodejs: https://nodejs.org/en/docs/es6/
- ember: https://github.com/sky-uk/agent-console/blob/em-data/ember-cli-build.js
ES6 and Wenguins
By David Thompson
ES6 and Wenguins
- 597