Cloning objects in Javascript
· ☕ 3 min read
Cloning objects is easier than ever before, but you have to remember a few nuances.
We will discuss about two ways to clone/copy an object -
Deep copy: copy object so that any subsequent changes to new object does not reflect in older object Shallow copy: copy props and child objects of an object, but the new object keeps pointing to the original Both have their uses.