参见Object.assign()const obj1 = { a: 1, b: 2 };const obj2 = { b: 3, c: 4, d: 5 };const result = Object.assign(obj1, obj2);console.log(result);//{ a: 1, ...
参见Object.assign()const obj1 = { a: 1, b: 2 };const obj2 = { b: 3, c: 4, d: 5 };const result = Object.assign(obj1, obj2);console.log(result);//{ a: 1, ...