ES6数组扩展
ES数组
扩展运算符
var foo = function(a, b, c) {
console.log(a);
console.log(b);
console.log(c);
}
var arr = [1, 2, 3];
//传统写法
foo(arr[0], arr[1], arr[2]);
//使用扩展运算符
foo(...arr);
//1
//2
//3rest运算符
ES6数组方法
Array.from()
Array.of()
copyWithin
find()和findIndex()
fill()
entries(),keys()和values()
Array.prototype.includes
数组的空位
Last updated