const obj1 = { x : 1, y : 2 }; const obj2 = { z : 3 }; // add members obj1 and obj2 to obj3 const obj3 = {...obj1, ...obj2}; console.log(obj3); // {x: 1, y: 2, z: 3}