I trying to copy an object. I want to made it with algorithm Depth-First Search. I create a function which will be copy my object without links on old objects. I have a problem, my function doesn’t count the result correctly. Where do i make a mistake? Answer dfs without recursion use additional stack to track parent properties.
Tag: deep-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