What is this in javascript?
this keyword refers to an object, the object that is executing the current part of our Javascript code.
...
For further actions, you may consider blocking this person and/or reporting abuse
Very informative post! I just wanted to mention that in the case of events handled by
addEventListener
, if you pass an object that implements#handleEvent
, it will be called withevent
as its argument, and it will be implicitly bound to the object passed in toaddEventListener
. If you call any other functions on the object within the body ofhandleEvent
, they will also be implicitly bound to the object, too! This saves memory by preventing you from having to use#bind
or the arrow syntax for those functions, which both create copies of the function in question,. In circumstances where you have a large number of objects, this can save you a ton of overhead!