Arrow This
Arrow This | getiblog
Arrow functions don't bind at all this or arguments or anything else they resolve them by lexical scoping. This is interesting:
Arrow functions don't bind at all this or arguments or anything else they resolve them by lexical scoping. This is interesting:
> Dave said to me, essentially, “The ‘lexical this‘ phrase is troubling, because this has always been lexical.”
What's going on is that => DOES NOT bind
this
, because => arrow functions don't have a this
at all! So from there it's lexical scope to find this
which can misinterpreted as some kind of new interpretation (like the self = this
pattern or binding)More implications:
Arrow =>
can't be called with new
or bind(obj)
doesn't work either