For example if I have two objects:
var foo = { x: \"bar\", y: \"baz\" }
and
var oof = {}
and I want
You can return the destructured object in an arrow function, and use Object.assign() to assign it to a variable.
const foo = { x: "bar", y: "baz" } const oof = Object.assign({}, () => ({ x, y } = foo));