shallow copy and deepcopy in js code example Example: js shallow copy Object.assign({}, obj); // ES6 shallow copy