November 2022
Beginner
624 pages
13h 39m
English
In this Chapter
Get a broader overview of the this keyword
Explore solutions for ensuring this points to the right object by looking at approaches that involve arrow functions, redefining this, and using the bind method
In English, there are many situations where you need to refer to yourself:
I am hungry.
This teleportation device belongs to me.
I don’t know who microwaved the mustard.
I digress.
In JavaScript, things aren’t too different. We will write or encounter code where we need to refer to the current object in a very general way. The way we get a reference to this object is by the appropriately named this keyword. We’ve seen this keyword a few times already, but now it’s time for us to look deeper ...
Read now
Unlock full access