1. Destructuring references is not yet supported on Chrome
[a,b,c]=[c,d,f]
[a,b]=[b,a+b]
2. Shorthand functions are sweet [1,2,3,4].map(function(x) x*x)) // [1,4,9,16]
3. Chrome doesn't have an inbuilt shell (Shift+F4 in Firefox)Granted CoffeeScript makes some of these easy, but they are too paranoid in my opinion to support new and useful syntaxes (e.g. yield keyword for generators, getters/setters).
[1,2,3,4].map(x => x * x) // [1,4,9,16]
I wonder why they included two new shorter function syntax alternatives. Is one of them recommended/deprecated?This blog post explains the differences between these functions and current functions: http://javascriptweblog.wordpress.com/2012/04/09/javascript-...; i wish the unbound "->" alternative is included, so that functions used as methods can also use the new syntax.
Eh. Yea, Firefox got support for that (and `let` and generators/iterators), because they added it in 2006 (Firefox 2.0) as an experimental feature.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_...
[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_...List of all the goodies: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_...
edit: formatting