Last active
September 8, 2017 10:17
-
-
Save lspdv/ef4a2bf20191580e0dc984b796317b8c to your computer and use it in GitHub Desktop.
Given the following code, I understand what the output will be:
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
//Given the following code, I understand what the output will be | |
//Please answer fill only to the registration form for MSD Code Academy :-) | |
const obj = { | |
name: 'John', | |
getName () { | |
return this.name; | |
} | |
}; | |
const name1 = obj.getName(); | |
const getName = obj.getName; | |
const name2 = getName(); | |
console.log(`${name1} ${name2}`); | |
//A: "John John" | |
//B: "null John" | |
//C: "John undefined" | |
//D: It will throw an error | |
//E: Have no idea | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment