News for hackers. Stuff that matters.
Re:Arrow Functions Coming to Chrome 45 by moron4hire on Monday June 22, 2015 @02:48PM (#9760371)
> Relative to the other kind of function that is written like function (x) { return x * 2 }, arrow functions don't define this or arguments in their bodies, instead capturing these values from the environment.

In the case of `this`, I can see why they did that: it is the right semantics and all of JavaScript should be this way. But I really think creating two different behaviors for what should all just be syntactic sugar around the same, ol' function values is long-term going to reveal itself as a mistake.

But that's just `this`. I can't for the life of me imagine why they also did this for `arguments`.

Re:Arrow Functions Coming to Chrome 45 by ubertaco on Monday June 22, 2015 @03:00PM (#9760451)
I think that was largely to make it easier to deal with arrow functions in higher-order functions, though the only case I can see for "arguments" anymore is for varargs, and those are covered with the rest operator, so I'm not sure why the distinction is made.
Re:Arrow Functions Coming to Chrome 45 by moron4hire on Monday June 22, 2015 @03:01PM (#9760464)
ok, that makes sense. Yes, `arguments` is a shitty replacement for real varargs.