I have a nested JSON objects that looks like {“name”, “children”: [JSON objects]}. I am trying to add a new child to the object found with a variable path, an array of names. My code doesn’t work in my React Native app, however it does in the Chrome console, which makes me really confused. Does it have to do with
Tag: shallow-copy
Does Object.assign() create a deep copy or a shallow copy?
I just came across this concept of which creates a copy of original object into the “copy” object. However, my question is, does this way of cloning object create a deep copy or a shallow copy? PS: The confusion is, if it creates a deep copy, then it would be the easiest way to clone an object. Answer Forget about