News for hackers. Stuff that matters.
Re:Fat arrow functions in Javascript by jmcdonald-ut on Friday September 20, 2013 @04:51PM (#6420435)
Is there a reason why the author is referring to them as fat arrow functions instead of lambdas? I am not trying to be snarky, this is genuine curiosity if there is something differentiating.
Re:Fat arrow functions in Javascript by gwwar on Friday September 20, 2013 @05:30PM (#6420630)
If you recall, a lambda is just an anonymous function which javascript already has.

//an example of a self-executing anonymous function

(function(x) { return x * x; } (3)); //returns 9

arrow functions are a bit different in that:

* It has Lexical this (normally fixed in usual functions via closure or .bind())

* this cannot be redefined

* arrow functions cannot be used as a constructor

* arrow functions are always anonymous

See also: http://wiki.ecmascript.org/doku.php?id=harmony:arrow_functio...