Object.assign()和扩展操作符
1:Object.assign()用法:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/assign;
2:扩展操作符:...
let obj1 = {a:1,b:2};
console.log(obj1); {a:1,b:2}
let obj2 = {...obj1,a:3};
console.log(obj2) {a:3,b:2}
反思:obj2中的a的值会覆盖之前已经展开的a的值。