Shallow vs Deep copy
Posted on September 2, 2022
Tags: codeetc
Very misleading
- Shallow copy is not really more shallow than its counterpart.
Shallow copy means we recursively copy the object and set it to the new variable meaning a and b DO NOT refer to the same object.
Deep copy means we copy references so a and b refer to the same object.