Last active
August 29, 2015 14:07
-
-
Save lizlongnc/07102199a524cfe091d1 to your computer and use it in GitHub Desktop.
JS this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you using a function with an outside object, use this. | |
The this pseudo parameters contains a reference to the object of invocation. | |
this allows a method to know what object it is concerned with. | |
this allows a single function object to service many objects. | |
this is key to prototypal inheritance. | |
allows a single function to work on many objects | |
the way the function knows which object it is working on is by the this binding | |
this is a bonus parameter. Its value depends on the calling form. | |
this gives methods access to their objects | |
this is bound at invocation time. | |
Invocation form this | |
function the global object undefined | |
method the object | |
constructor the new object | |
apply argument |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment