js arguments.callee & caller的用法及区别
2015-01-16 16:39
681 查看
在函数内部,arguments.callee该属性是一个指针,指向拥有这个arguments对象的函数;
而函数对象的另一个属性:caller,这个属性保存着调用当前函数的函数的引用,如果是在全局作用域中调用当前函数,它的值为null。
而函数对象的另一个属性:caller,这个属性保存着调用当前函数的函数的引用,如果是在全局作用域中调用当前函数,它的值为null。
<script type="text/javascript"> function inner(){ alert(arguments.callee); //指向拥有这个arguments对象的函数,即inner() alert(arguments.callee.caller);//这个属性保存着调用当前函数的函数的引用,即outer() } function outer(){ inner(); } outer(); </script>
相关文章推荐
- js arguments.callee.caller.…
- js中arguments,caller,callee,apply的用法小结
- js中arguments,caller,callee,apply的用法小结
- js中arguments,caller,callee,apply的用法小结
- js中arguments,callee,caller的用法小结
- js中arguments,caller,callee,apply的用法小结
- js apply/call/caller/callee/bind使用方法与区别分析
- js函数的内部属性---arguments,callee,caller
- js经验点滴js apply/call/caller/callee/bind使用方法与区别分析
- js中的arguments,apply,call,callee,caller
- js apply/call/caller/callee/bind使用方法与区别分析
- js apply/call/caller/callee/bind使用方法与区别分析
- js apply/call/caller/callee/bind使用方法与区别分析
- js中的caller,callee,call,apply用法详解
- js apply/call/caller/callee/bind使用方法与区别分析
- [转载]js中的arguments,caller,callee,apply
- js的arguments,callee,caller,length,prototype属性
- js中的arguments,caller,callee,apply
- javascript 中的 arguments,callee.caller,apply,call 区别
- js中的arguments,caller,callee,apply