Purecode | Cloning Objects and Arrays
When it comes to cloning objects or arrays, the spread operator comes to the rescue. It allows us to create a shallow clone of an array by distributing an existing array’s elements into a new array. Remember, it creates only a shallow copy, so nested objects or arrays will still reference their original counterparts.














