this
Keyword
this Keyword
A function's this
keyword behaves a little differently in
JavaScript compared to other languages. It also has some differences between strict mode and non-strict
mode.
In most cases, the value of this
is determined by how a
function is called (runtime binding). It can't be set by assignment
during execution, and it may be different each time the function is
called. The bind()
method can set the value of a function's this
regardless of how it's called, and arrow functions don't provide their own this
binding (it retains the this
value of the enclosing lexical context).