object.assgin(对象1,被添加到对象1中的对象)
此方法是深拷贝对象,不改变原来的对象
let apple={
color:'red',
price:15
}
let dog={
name:'coco'
}
let newObject=Object.assign(apple,dog)
newObject.name='cici'
console.log(newObject,apple); //coco
console.log(dog) //cici