1、Array.prototype.slice.call(arguments)
2、[].slice.call(arguments)
3、[...arguments]
4、Array.from(arguments)
要把类数组转换成数组的原因:
类数组缺少部分的数组API,比如: slice, forEach, map 等集合函数
1、Array.prototype.slice.call(arguments)
2、[].slice.call(arguments)
3、[...arguments]
4、Array.from(arguments)
要把类数组转换成数组的原因:
类数组缺少部分的数组API,比如: slice, forEach, map 等集合函数