Skip to content

Instantly share code, notes, and snippets.

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 indongyoo/c199c7541fc2f1c1500b887f97857df3 to your computer and use it in GitHub Desktop.
Save indongyoo/c199c7541fc2f1c1500b887f97857df3 to your computer and use it in GitHub Desktop.
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