Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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