What is difference between deep and shallow object coping in JavaScript?
What is difference between deep and shallow object coping in JavaScript?
devquora
Posted On:
Feb 22, 2018
Some differences are:
Deep copy means copies all values or properties recursively in the new object whereas shallow copy copies only the reference.
In a deep copy, changes in the new object don't show in original object whereas, in shallow copy, changes in new objects will reflect in the original object.
In a deep copy, original objects do not share the same properties with new object whereas, in shallow copy, they do.