Notes taken on a ECMAScript 6 features overview.
MDN docs: rest parameters; spread operator;
// Rest parameters
function restEx(x, ...y) {
// y is an array of args w/ index 1 & beyond
}
// Spread operator
function spreadEx(x, y, z) {
return x + y + z;
}
spreadEx(...[1, 2, 3]); // 6You can declare iterators, which allow you to do iterator-based iteration:
for (let person of people) {
}-
you can export things from other modules in a model with the
exportkeyword -
you can load modules dynamically with
System.import('module').then((m) => {})
Map,Set,WeakMap,WeakSet
Symbols are a new primitive type
Array.of(arg1, arg2, ...)Array.from([some arg])returns a real Array- Array:
.fill,.find,.findIndex,.copyWithin,.entries(),.keys(),.values()