目录:数组
类数组对象(Array-like)this
/** argument 类数组对象 */ Array.prototype.slice.call(arguments) /** 简写 */ [].slice.call(arguments)
参数:类数组对象、可迭代的对象prototype
Array.from(arrayLike[,mapFn[,thisArg]]) // 用法 Array.from(arguments)
Array(7) // 建立一个长度为7的空(empty)数组 [,,,,,,] Array.of(7) // [7]
剩余参数语法code
const toArr = (...args) => args toArr(1,2,3,4) // [1,2,3,4]