📅  最后修改于: 2022-03-11 15:03:18.688000             🧑  作者: Mango
var myObject = {
label: 'foo',
name: 'bar',
id: 12
};
myObject = {...myObject, label: 'baz', name: 'qux'};
console.log(myObject);
// Or, if your update is contained in its own object:
var myUpdate = {
label: 'something',
name: 'else'
}
myObject = {...myObject, ...myUpdate}
console.log(myObject)