|
|
|
|
|
by bazsouthafrica
4998 days ago
|
|
I realise that everyone is critic, but I am sorry: I understand fully how `this` gets bound and how scoping works in Javasscript. And it sucks! Scoping: Javascript uses C/Java notation but it does not have block scope, only function scope. That to me seems very misleading. And with regards to `this`, the way function invocation sets `this` differs totally from method invocation. How can this not be a problem! |
|
Yes, it is, but we weren't talking about that problem. That is already solved in ES6 with `let`, which is approved and will be available in about a year.
> And with regards to `this`, the way function invocation sets `this` differs totally from method invocation. How can this not be a problem!
Function and method invocation are different things, with different semantics. It's like that in many other languages too. Sure, the way `this` is handles is a problem sometimes, but I think it's overblown.