📜  更新字典中的某个键 javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:10.503000             🧑  作者: Mango

代码示例1
const target = {c: 4, d: 5}
const source = {a: 1, b: 2, c: 3};

const newObj = Object.assign({}, target, source);

console.log(newObj); //=> {a: 1, b: 2, c: 3, d: 5}