3 ms·
The currently being worked on future version of javascript will have less verbose syntax. Brendan Eich has blogged[1] about his proposals. Instead of (func
by starwed 15y ago
The currently being worked on future version of javascript will have less verbose syntax. Brendan Eich has blogged[1] about his proposals.
Instead of
(function(x) { return x * x })
you could just write
#(x) { x * x }.
[1]http://brendaneich.com/2011/01/harmony-of-my-dreams/ http://brendaneich.com/2011/01/harmony-of-my-dreams/
- nxn 15y agoI thought the # shorthand for functions proposal was rejected?
- jashkenas 15y agoIt was indeed. None of the function shorthands made it into ES.next, but the current leading contenders are: http://wiki.ecmascript.org/doku.php?id=strawman:arrow_function_syntax http://wiki.ecmascript.org/doku.php?id=strawman:arrow_functi... (x) -> x * x And http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revival http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda... {|x| x * x}
- reaktivo 15y agoI really like the way functions are declared in Kaffeine[1]: (x) { x * x } [1] http://weepy.github.com/kaffeine/docs/function_extensions.html http://weepy.github.com/kaffeine/docs/function_extensions.ht...