For example if I have two objects:
var foo = { x: \"bar\", y: \"baz\" }
and
var oof = {}
and I want
You can just use restructuring for that like this:
const foo = {x:"a", y:"b"}; const {...oof} = foo; // {x:"a", y:"b"}
Or merge both objects if oof has values:
const foo = {x:"a", y:"b"}; let oof = {z:"c"} oof = Object.assign({}, oof, foo)