分类:
版权声明:本文为博主原创文章,未经博主允许不得转载。
1.前言
arguments, caller , callee 是什么?
在javascript 中有什么样的作用?本篇会对于此做一些基本介绍。
2. arguments
arguments: 在函数调用时, 会自动在该函数内部生成一个名为 arguments的隐藏对象。 该对象类似于数组, 但又不是数组。可以使用[]操作符获取函数调用时传递的实参。
看上去很简单。 需要注意的是 argument 保存的实参的信息。
上面有说, arguments 不是一个数组,何以见得? 执行以下部分就可以知道了
对于以上立即执行函数写法不清楚的话, 可以参考
http://blog.csdn.net/oscar999/article/details/8507919
看上去很简单。 需要注意的是 argument 保存的实参的信息。
上面有说, arguments 不是一个数组,何以见得? 执行以下部分就可以知道了
对于以上立即执行函数写法不清楚的话, 可以参考
http://blog.csdn.net/oscar999/article/details/8507919
只有函数被调用时,arguments对象才会创建,未调用时其值为null:
arguments 的完整语法如下:
[function.]arguments[n]
参数function :选项。当前正在执行的 Function 对象的名字。 n :选项。要传递给 Function 对象的从0开始的参数值索引。
arguments 的完整语法如下:
[function.]arguments[n]
参数function :选项。当前正在执行的 Function 对象的名字。 n :选项。要传递给 Function 对象的从0开始的参数值索引。