Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Show HN: Learn and practice modern JavaScript. Parent comment
In practice the only thing you absolutely need to know is the spread syntax for arrays `blist=[...alist]` and objects `objb={...obja}` that will trick you up if you're never seen in before
alist = [1,2,3] blist = [...alist, 4] // == [ 1, 2, 3, 4 ] obj = { a: 5, b: 6 } obj2 = { ...obj, c:7 } // == { a: 5, b: 6, c: 7 }
There is also this weird shortcut for creating objects for which key and value use the same identifier:
d=8 e=9 obj = { d, e } // shorthand for {d:d, e:e} // == { d: 8, e: 9 }
In practice the only thing you absolutely need to know is the spread syntax for arrays `blist=[...alist]` and objects `objb={...obja}` that will trick you up if you're never seen in before
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...There is also this weird shortcut for creating objects for which key and value use the same identifier: