运行时用于获得函数的引用,例子如下:
- <script>
- var show=function(){
- // debugger;
- //alert(arguments[0]);
- if(arguments[0]==0)return;
- else{
- alert(arguments[0]);
- arguments.callee(0);//通过arguments.callee获得其函数的引用,并调用;
- }
- }
- // show(5);
- var factorial=function(x){
- if(x<2)return 1;
- else return x*arguments.callee(x-1);
- }
- var x=factorial(5);
- alert(x);
- </script>