典型类数组为function的参数
const test = (args) => {
console.log(args) // Arguments [Array(4), callee: ƒ, Symbol(Symbol.iterator): ƒ]
}
判断是否为类数组
const isArrayLike = (val) => {
return val !== null && val.length > 0 && Object.prototype.toString.call(val) !== '[Object Function]'
}
类数组转数组
const convertToArray = (val) => {
return Array.prototype.slice.call(val)
}