将参数转换为数组arguments并不是真正的数组,它有length属性,但没有其他数组的方法,如果想使用数组的方法,
将参数转换为数组
arguments并不是真正的数组,它有length属性,但没有其他数组的方法,如果想使用数组的方法,可以将arguments转换成数组,这是javascript脚本引擎转换的结果
Array.prototype.slice.apply(arguments);
将参数转换为数组
arguments并不是真正的数组,它有length属性,但没有其他数组的方法,如果想使用数组的方法,可以将arguments转换成数组,这是javascript脚本引擎转换的结果
Array.prototype.slice.apply(arguments);