Skip to content

Instantly share code, notes, and snippets.

@sranso
Last active August 29, 2015 14:04
Show Gist options
  • Save sranso/8de09221a0dd4b208e69 to your computer and use it in GitHub Desktop.
Save sranso/8de09221a0dd4b208e69 to your computer and use it in GitHub Desktop.
var object = {
levelOne: function(activity, emotion) {
console.log('we\'re playing', activity, 'and we feel', emotion, 'about it.')
}
}
object.levelOne('baseball', 'bored');
//>> we're playing baseball and we feel bored about it.
object.levelOne.apply(this, ['baseball', 'bored']);
//>> we're playing baseball and we feel bored about it.
// blerg. but still kind of accurate? ;)
object.levelOne.call(this, ['baseball', 'bored']);
//>> we're playing ["baseball", "bored"] and we feel undefined about it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment