标签:js
Js在函数调用时会创建一个隐式的的对象arguments。App = {}; App.fun0 = function(){ console.log(arguments) }; App.fun1 = function(arg1){ console.log(arguments) }; App.fun2 = function(arg1, arg2){ console.log(arguments) }; App.call1 = function(){ this.fun0(); this.fun1(1); this.fun2(1,2); }; App.call2 = function(){ this.fun1(); this.fun1(1); this.fun1(1,2); }; App.call1(); App.call2();
var sum = function(n){ if(1==n) { return 1; } else { return n + arguments.callee(n-1); } } console.log(sum(10));
标签:js
原文地址:http://blog.csdn.net/xufeng0991/article/details/45559229