Created
May 16, 2016 10:23
-
-
Save mariyadiminsky/966674f54af74e3494f3ecb687212c4a 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
// Test it here: https://jsfiddle.net/maasha/u8ybgwd5/ | |
var bunny = { | |
name: 'Usagi', | |
tasks: ['transform', 'eat cake', 'blow kisses'], | |
showTasks: function() { | |
this.tasks.forEach(function(task) { | |
alert(this.name + " wants to " + task); | |
}.bind(this)); | |
} | |
}; | |
bunny.showTasks(); | |
// Usagi wants to transform | |
// Usagi wants to eat cake | |
// Usagi wants to blow kisses |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment