Skip to content

Instantly share code, notes, and snippets.

@lspdv
Last active September 5, 2017 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lspdv/549eea3286312c5a77b4e37d8ad95f95 to your computer and use it in GitHub Desktop.
Save lspdv/549eea3286312c5a77b4e37d8ad95f95 to your computer and use it in GitHub Desktop.
Finish line `var sayHello = ` so the whole code example prints "Hello John" to the console
//Finish line `var sayHello = ` so the whole code example prints "Hello John" to the console
//Please answer fill only to the registration form for MSD Code Academy :-)
var hello = {
name: 'John',
sayHello: function() {
return 'Hello ' + this.name
}
}
var sayHello = ...
console.log(sayHello())
//A: var sayHello = hello.sayHello
//B: var sayHello = hello.sayHello()
//C: var sayHello = hello.sayHello.call(hello)
//D: var sayHello = hello.sayHello.bind(hello)
//E: Have no idea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment