一、...
let obj1 = {top:100,left:200};
let obj2 = {height:500,width:200};
let obj3 = {
...obj1,
...obj2,
}
console.log(obj3) //{top: 100, left: 200, height: 500, width: 200}
2.数组 [1,2,3,4] => 1,2,3,4
let arr1 = [1,2,3,4,5];
console.log(...arr1);//1,2,3,4,5
console.log(Math.max(...arr1)) 等同于 Math.max(1,2,3,4,5)
网友评论