Created
August 31, 2011 11:20
-
-
Save e7h4n/1183323 to your computer and use it in GitHub Desktop.
This file contains 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
var dog = { | |
home: 'Doggy house', | |
bark: function() { | |
alert(this + ' is me.'); | |
alert(this.home + ' is my home!'); | |
} | |
}; | |
dog.bark(); // [object Object] is me. Doggy house is my home. | |
{bark: dog.bark}.bark(); // 5 分 | |
(dog.bark, dog.bark)(); // 5 分 | |
dog.bark.call(dog); // 5 分 | |
[dog.bark][0](); // 10 分 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment