const first = { a: 1 }; const second = { b: 2 }; const merged = { ...first, ...second }; console.log(merged) // { a: 1, b: 2 }