const person = { name: 'David Walsh', gender: 'Male' };
const tools = { computer: 'Mac', editor: 'Atom' };
const attributes = { handsomeness: 'Extreme', hair: 'Brown', eyes: 'Blue' };
方法
一、ES6擴展運算符
const summary = {...person, ...tools, ...attributes};
console.log(summary);
輸出結果:

二、Object.assign() 方法用於將所有可枚舉屬性的值從一個或多個源對象復制到目標對象。它將返回目標對象。
var newObj = Object.assign(person, tools, attributes); console.log(newObj);
輸出結果:

