1、Call(this,arr1,arr2,arr3...)時(shí)可以直接調(diào)用Call(this,[...args])
2、arr1.push(...arr2),直接省了contact操作
3、arr1=[1,2,3,...arr2,4,5]
4、拷貝數(shù)組
arr1=[1,2,3,4,5];
arr2=[...arr1] <===> arr2=arr1.slice();
直接拷貝堆內(nèi)存,不是引用地址
5、函數(shù)傳參
arr = [1,2,4,55,];
Math,max(...arr); ? //55
Math.min(...arr); ?? //1
6、將類數(shù)組轉(zhuǎn)成數(shù)組,當(dāng)然es6中的Array.from(LikeArray)同樣可以做到
[...oUl.getElementByTagNames()].forEach(( val,index,arr )=>{
? ? ? [ Some Code ]
})
7、用在對象中,解構(gòu)賦值
const props = {
name : "xxx",
age : "yyy",
handleClick:function(){
Some Code
}
};
let { name , ...other } = props;
name =>"xxx"?
other=>{
age : "yyy",
handleClick:function(){
Some Code
}
?
?