2 ms·
Here is a language diff that shows when new language features added to Firefox. This might be helpful to get an exhaustive list of the changes: https://develop
by ivan_ah 8y ago
Here is a language diff that shows when new language features added to Firefox. This might be helpful to get an exhaustive list of the changes:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_2015_support_in_Mozilla https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_...
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 }
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax 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:
d=8
e=9
obj = { d, e } // shorthand for {d:d, e:e}
// == { d: 8, e: 9 }
- arethuza 8y agoI wouldn't say that latter thing is a "weird shortcut" - C# has had that for a while and I rather like it. :-)