difference between object clone and object copy in javascript code example Example: js shallow copy Object.assign({}, obj); // ES6 shallow copy