Created
January 10, 2014 19:47
-
-
Save amadeus/8361324 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 num = 1; | |
| var num2 = num; | |
| num++; | |
| console.log(num); // 2 | |
| console.log(num2); // 1 | |
| var obj = { | |
| val: 'A string' | |
| }; | |
| var obj2 = obj; | |
| obj.val = 'a new value'; | |
| console.log(obj === obj2); // true | |
| console.log(obj.val); // 'a new value' | |
| console.log(obj2.val); // 'a new value' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment