Skip to content

Instantly share code, notes, and snippets.

@nrmitchi
Created March 27, 2013 17:09
Show Gist options
  • Save nrmitchi/5256118 to your computer and use it in GitHub Desktop.
Save nrmitchi/5256118 to your computer and use it in GitHub Desktop.
Small proof of js passing by reference
var a = { 'a': 1, 'b':2 };
var b = a
console.log(a);
console.log(b);
//Note that they are the same
b.a = 3
console.log(a);
console.log(b);
//Note that a.a now = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment