- Block scopes with
letandconstletinforloop rebinds variable on each iteration
- lexical
this(instead of dynamic one) with arrow functions - method definitions ?
- shorthand object properties
var = {foo, bar}
- computed property names
{ [name()]: value }
- getter & setter methods
- Symbols
- custom
for of:Symbol.iterator
- custom
- classes
- can contain only method definitions (no data fields)
- constructor / static methods / prototype methods / symbol methods
- useless subtlety:
new.target
- string interpolation with
${}String.rawto escape backslashes
- new collections
- Map (arbitrary datatypes as keys -- not only strings as in objects)
set/get/has/delete/clear/forEach/keys/values/entries- using objects as maps are still ok if you know your key-value pairs when you write your code
- iterating over the entries is tricky if you use objects
- maps preserve order of insertions when iterating
- Set
add/has/delete/clear
- WeakMap / WeakSet
- Map (arbitrary datatypes as keys -- not only strings as in objects)
- generators
- beware of
returnandfor .. of - delegating generators with
yield * - async programming
- beware of
- https://scotch.io/tutorials/better-node-with-es6-pt-i
- https://scotch.io/tutorials/better-javascript-with-es6-pt-ii-a-deep-dive-into-classes
- https://scotch.io/tutorials/better-javascript-with-es6-pt-iii-cool-collections-slicker-strings
- https://davidwalsh.name/es6-generators
- http://exploringjs.com/es6/ch_overviews.html
- http://frontender.info/asynchronous-javascript/