Skip to content

Instantly share code, notes, and snippets.

@jimbol
Created March 25, 2016 18:13
Show Gist options
  • Save jimbol/5d5a3e3875c34abcf60a to your computer and use it in GitHub Desktop.
Save jimbol/5d5a3e3875c34abcf60a to your computer and use it in GitHub Desktop.
Object.assign doesn't deep copy
a = {b: 1, c:{ d:3 }}
z = Object.assign({}, a)
z.c.d = 4
console.log(a.c.d) // 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment