Skip to content

Instantly share code, notes, and snippets.

@mariyadiminsky
Last active May 16, 2016 10:21
Show Gist options
  • Save mariyadiminsky/cb6d6fb9accf0a71edf453ea4eb21fa3 to your computer and use it in GitHub Desktop.
Save mariyadiminsky/cb6d6fb9accf0a71edf453ea4eb21fa3 to your computer and use it in GitHub Desktop.
// Test it here: https://jsfiddle.net/maasha/3mu5r6vg/
var bunny = {
name: 'Usagi',
tasks: ['transform', 'eat cake', 'blow kisses'],
showTasks: function() {
var _this = this;
this.tasks.forEach(function(task) {
alert(_this.name + " wants to " + task);
});
}
};
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