What is `this` inside foo.bar()?
The problem
Calling a method directly works as expected.But when we pass a method as callback, it loses reference to the original object (as this) when called.
Why is that? Can the spec help us explain this difference?
The explanation
For methods,
...
bendtherules.hashnode.dev
Aquib Vadsaria
Software Developer in pursue of becoming Software Engineer
Wonderful well written article, Beautifully mapped/explained the ES specs to understand the JS concepts Thanks for sharing :)