-
-
Save rumikotakahashi/e8c4305594ea2b55bd2ca96eb0f0819f to your computer and use it in GitHub Desktop.
Given the following code, I understand what the output will be:
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
| const obj = { | |
| name: 'John', | |
| getName () { | |
| return this.name; | |
| } | |
| }; | |
| const name1 = obj.getName(); | |
| const getName = obj.getName; | |
| const name2 = getName(); | |
| console.log(`${name1} ${name2}`); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great!