Home / Javascript Tips Generated By ChatGPT / Using Object.assign for Merging Objects in Javascript Merge multiple objects into a single object. Source Code let obj1 = { a: 1 }; let obj2 = { b: 2 }; let merged = Object.assign({}, obj1, obj2); console.log(merged);