Nguyễn Huy Hùng
Education Section, Human Development Division
1.1 Why "this"?
1.2 Confusions: itself
1.2 Confusions: its scope
1.3 What's "this"?
3.1 Default Binding
3.2 Implicit Binding
3.3 Explicit Binding
3.4 "new" Binding
4.1 Ignored "this"
4.2 Indirection
4.3 Softening Binding
Determining the this binding for an executing function requires finding the direct call-site of that function. Once examined, four rules can be applied to the call-site, in this order of precedence:
Called with new? Use the newly constructed object.
Called with call or apply (or bind)? Use the specified object.
Called with a context object owning the call? Use that context object.
Default: undefined in strict mode, global object otherwise.