this in JavaScript
What is this in JavaScript?
The value that this stores is the current execution context of the JavaScript program.Thus, when used inside a function this‘s value will change depending on how that function is defined, how it is invoked and the default execution context.
Note : this always holds the reference to a single object, that defines the current line of code’s execution context.