Grokking Advanced JavaScript
Vote

0% completed

​

The this Keyword

What does this refer to inside a function? The answer surprises many developers: it depends on how the function is called, not on where the function is written. The same function can see a different this on every call.

The keyword this is a value that JavaScript passes to a function each time the function is called, alongside the arguments. You cannot assign to this inside the function. Instead, you control it through the form of the call. The examples below follow one person object through each form of call.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content