Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on A summary of ECMAScript 6 features. Parent comment
> Splats (spreads?) > f(...[1,2,3]) == 6 > ... means destructure?
f.apply(this, [1,2,3])
function f(x, y, z) { return x + y + z; } a = [1,2]; b = [3]; [...a, ...b] == [].concat(a,b) == [1,2,3] [0, ...a, 4, 5, ...b, 6] == [].concat([0],a,[4,5],b,[6]) == [0,1,2,4,5,3,6] f(...a, ...b) == 6 f(1, 2, ...b) == 6 f(...a, 3) == 6 f(...b, 0, ...b) == 6
Want some cheese with that whine? It got more complicated, yes. But I'm liking most of the changes, personally. A lot. Most of them are long overdue.
BTW, if you open Firefox's console, you can try out many examples. Firefox already supports tons of ES6.
There are no comments on this comment yet.
Want some cheese with that whine? It got more complicated, yes. But I'm liking most of the changes, personally. A lot. Most of them are long overdue.
BTW, if you open Firefox's console, you can try out many examples. Firefox already supports tons of ES6.