Last active
April 3, 2018 12:16
-
-
Save indongyoo/c199c7541fc2f1c1500b887f97857df3 to your computer and use it in GitHub Desktop.
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
const log = console.log; | |
var a = 10; | |
function f1(a2) { | |
a2 = 5; | |
log(a2); // 5 | |
log(a); // 10 | |
} | |
f1(a); | |
const obj = { value: 10 }; | |
function f2(obj2) { | |
obj2.value = 5; | |
log(obj2); // { value: 5 } | |
log(obj); // { value: 5 } | |
log(obj == obj2); // true | |
} | |
f2(obj); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment