慕妹3242003
const oldUser = { username: 'old', age: 18}const newUser = { age: 19, dream: 'fly'}const user = {...oldUser, ...newUser} // 相当于 user = { username: 'old', age: 18, age: 19, dream: 'fly'}// 如果key重复,后面值会覆盖前面, 所以最后 // user = { username: 'old', age: 19, dream: 'fly'}一般用来合并对象,拷贝对象,分解传参用的。