Skip to content

Instantly share code, notes, and snippets.

@e7h4n
Created August 31, 2011 11:20
Show Gist options
  • Save e7h4n/1183323 to your computer and use it in GitHub Desktop.
Save e7h4n/1183323 to your computer and use it in GitHub Desktop.
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