JavaScript version
const shallowCopy = obj => Object.assign({}, obj);// orconst shallowCopy = obj => {...obj};