Created
March 4, 2011 22:07
-
-
Save harthur/855791 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
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