Created
March 25, 2016 18:13
-
-
Save jimbol/5d5a3e3875c34abcf60a to your computer and use it in GitHub Desktop.
Object.assign doesn't deep copy
This file contains 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
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