Question
So does the value of this
always change?
Answer
The value of this
depends on how a function is called. Its value can be different every time a function is called. That’s why context is really important when dealing with the this
keyword! If it gets confusing for you while coding, it may help to run a quick console.log()
to check for the value of this
before proceeding further in your code.