3 ms·
So let me get this straight... a whole new function syntax is being introduced, just to replace: var that = this; var f = function() { return tha
by crazygringo 13y ago
So let me get this straight... a whole new function syntax is being introduced, just to replace:
var that = this;
var f = function() {
return that.x;
}
with:
var f = () => {
return this.x;
}
I mean, that's it? That's the whole benefit? Am I missing something else here? Please tell me I am.
JavaScript is already tricky enough to keep track of everything having to do with "this", now they're adding extra complexity to that too by having multiple types of functions that treat "this" even more differently? (Since it's not like they're removing the original behavior...)