Im curious when it is needed/best practice to use the keyword this
. I understand that this
is used when determining a functions this
value
For a starting JS developer it might be easiest to get concept of This by using it in an event listener callback. I. e., "click" event binds This to object which is the target (Like "look, i clicked on THIS!").
- Item 1
- Item 2
- Item 3
Of course Rajeshs answer is much, much more complex, but I hope THIS can be also helpful…