DEV Community

Discussion on: Shallow Copy and Deep Copy

Collapse
 
curiousdev profile image
CuriousDev

I think, depending on what you want to achieve, you should create your own copy function. This way you can decide for every reference, if it has to be cloned (new object) or be kept (as a reference).