Last active
May 16, 2016 10:11
-
-
Save mariyadiminsky/64454e590d14610318e1d988813f74a2 to your computer and use it in GitHub Desktop.
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
// Test it here: https://jsfiddle.net/maasha/z65c1znn/ | |
var bunny = { | |
name: 'Usagi', | |
tasks: ['transform', 'eat cake', 'blow kisses'], | |
showTasks: function() { | |
this.tasks.forEach(function(task) { | |
alert(this.name + " wants to " + task); | |
}); | |
} | |
}; | |
bunny.showTasks(); | |
// [object Window] wants to transform | |
// [object Window] wants to eat cake | |
// [object Window] wants to blow kisses | |
// please note, in jsfiddle the [object Window] is named 'result' within inner functions of methods. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment