Shallow copy an object
JavaScript version
const shallowCopy = obj => Object.assign({}, obj);
// or
const shallowCopy = obj => {...obj};
JavaScript version
const shallowCopy = obj => Object.assign({}, obj);
// or
const shallowCopy = obj => {...obj};