【发布时间】:2016-01-27 16:39:16
【问题描述】:
寻找有关执行以下操作时究竟发生了什么的更多详细信息:
function useArray(){
var args = [].slice.call(arguments)
console.log(args)
}
为什么slice 是一个具有 3 个参数(源数组、要复制的开始和结束位置)威胁arguments 的函数?方法 call 需要第一个参数的正确值,因为 this 但似乎 arguments 变成了 Array 对象?
以及为什么这不起作用:
var args = [].slice(arguments)
【问题讨论】:
标签: javascript arrays function arguments