Last active
May 12, 2018 07:41
-
-
Save triacontane/1c9d1e332d912406f4d95b9af7405f42 to your computer and use it in GitHub Desktop.
Objectを返す関数を実行した場合のObjectの参照先について
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 getObj = function () { | |
| return { | |
| aaa:1, | |
| bbb:2, | |
| ccc:3 | |
| }; | |
| }; | |
| const obj1 = getObj(); | |
| const obj2 = getObj(); | |
| obj1.aaa = 4; | |
| console.log(obj2.aaa); // 1 or 4 ??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment