将参数转换为数组
arguments并不是真正的数组,它有length属性,但没有其他数组的方法,如果想使用数组的方法,可以将arguments转换成数组,这是javascript脚本引擎转换的结果
Array.prototype.slice.apply(arguments);
发布时间: 2012-10-08 19:54:56 作者: rapoo
将参数转换为数组
arguments并不是真正的数组,它有length属性,但没有其他数组的方法,如果想使用数组的方法,可以将arguments转换成数组,这是javascript脚本引擎转换的结果
Array.prototype.slice.apply(arguments);