Deep Copy vs Shallow Copy
Shallow Copy:
A shallow copy creates a new object, but the properties of that object still refer to the same memory locations as the original object's properties. This is what happened in your array example
Deep Copy:
A deep copy creates a new object, and it also creates copies of all the properties within that object, including any nested objects or arrays. The new object and its properties are completely independent of the original object.