News for hackers. Stuff that matters.
Re:Replacing ‘that = this’ assignments in JavaScript with Ar... by andrewstuart2 on Friday April 14, 2017 @06:31PM (#14117926)
Unless javascript removes alternate meanings of `this`, which will never happen, it does not have a language-level solution. In fact, I think it's easily as reasonable a solution as lambdas. I may be biased because I think ES6 is a hot mess, but the lack of `this` binding of lambdas is a serious misstep IMO.

If anything, ES6 lambdas add yet another way of interpreting `this` because while it is a function, it's not functionally scoped. Even better, a lambda is a function but `call` and `apply` are interpreted differently [1] since `this` is not bound. If you ever need to use `call` or `apply`, you'll have to know exactly how the called code is implemented to avoid bugs.

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

There are no comments on this comment yet.