拓展运算符(…)用于取出参数对象所有可遍历属性然后拷贝到当前对象。

    1. // 1、拷贝对象
    2. let person1 = {name: "Amy", age: 15}
    3. let someone = { ...person1 }
    4. console.log(someone) //{name: "Amy", age: 15}
    5. // 2、合并对象
    6. let age = {age: 15}
    7. let name = {name: "Amy"}
    8. let person2 = {...age, ...name}
    9. console.log(person2) //{age: 15, name: "Amy"}