Hacker News new | ask | show | jobs
by starwed 5468 days 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/
2 comments

I really like the way functions are declared in Kaffeine[1]:

  (x) { x * x }
[1] http://weepy.github.com/kaffeine/docs/function_extensions.ht...
I thought the # shorthand for functions proposal was rejected?
It 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_functi...

    (x) -> x * x
And http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda...

    {|x| x * x}