1、Call(this,arr1,arr2,arr3...)時可以直接調用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();
直接拷貝堆內存,不是引用地址
5格了、函數(shù)傳參
arr = [1,2,4,55,];
Math,max(...arr); ? //55
Math.min(...arr); ?? //1
6、將類數(shù)組轉成數(shù)組盛末,當然es6中的Array.from(LikeArray)同樣可以做到
[...oUl.getElementByTagNames()].forEach(( val,index,arr )=>{
? ? ? [ Some Code ]
})
7、用在對象中肤频,解構賦值
const props = {
name : "xxx",
age : "yyy",
handleClick:function(){
Some Code
}
};
let { name , ...other } = props;
name =>"xxx"?
other=>{
age : "yyy",
handleClick:function(){
Some Code
}
?
?