js duplicate an object code example Example: copy object javascript var x = {myProp: "value"}; var y = Object.assign({}, x);