I'm a beginner javascript student , I have a problem with understanding the main goal of the keyword this
and how to use it .
Please can anyone help me with examples.
Thanks in advance.
I'm a beginner javascript student , I have a problem with understanding the main goal of the keyword this
and how to use it .
Please can anyone help me with examples.
Thanks in advance.
The this keyword is a reserved keyword that, in general, is bound to an object.
When this appears in the body of a function, the object that is referenced by this usually depends on how the function was called.
There are many subtle details that can be found on MDN.this
Frequent accepted usage that you will encounter (beware, this is not always the case depending on ... the context) :