Skip to content

Instantly share code, notes, and snippets.

@harthur
Created March 4, 2011 22:07
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 harthur/855791 to your computer and use it in GitHub Desktop.
Save harthur/855791 to your computer and use it in GitHub Desktop.
var x = 4;
function change(v) {
v = v + 9;
}
change(x);
console.log(x); // 4
var x = { b: 4};
function change(v) {
v.b = v.b + 9;
}
change(x);
console.log(x); // { b: 13}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment