Skip to content

Instantly share code, notes, and snippets.

@gbhasha
Forked from nesbtesh/immutability.js
Created November 26, 2016 02:52
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 gbhasha/a1bd7ac5f9333c758e0cac03b092ab2d to your computer and use it in GitHub Desktop.
Save gbhasha/a1bd7ac5f9333c758e0cac03b092ab2d to your computer and use it in GitHub Desktop.
var object1 = {color: "blue", size: 12};
var object2 = object1
object2.color = "red"
object1 === object2 //true
object3 = Object.assign({}, object1)
object3.color = "red"
object1 === object3 //false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment