Skip to content

Instantly share code, notes, and snippets.

@amadeus
Created January 10, 2014 19:47
Show Gist options
  • Select an option

  • Save amadeus/8361324 to your computer and use it in GitHub Desktop.

Select an option

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