JavaScript: Function Call, Apply, Bind
In JavaScript, any function defined by function
, when called, has a associated value called “this binding”.
In function body, the value of “this binding” is represented by the keyword this
.
[see this Binding]
When a function f is a property of a object x, and is called in the form x.f(…)
, the value of “this binding” is the object x.
The following are ways to let you call a function and explicitly pass a value of your choice for this
binding.