4 ms·
Shorthand functions are not standard yet. You should bet on arrow function expressions in Harmony for now: [1,2,3,4].map(x => x*x)) // [1,4,9,16] (also note
by blueveek 13y ago
Shorthand functions are not standard yet. You should bet on arrow function expressions in Harmony for now:
[1,2,3,4].map(x => x*x)) // [1,4,9,16]
(also note that |this| is lexically bound in the case of fat arrow functions)
Also, destructuring objects:
let obj = { foo: 42, bar: { baz: 32 } }
let { foo, bar } = obj;
foo // 42
bar.baz // 32
https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7 https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_...
List of all the goodies:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_...
edit: formatting