标签:
函数格式
function getPrototyNames(o,/*optional*/ a) { a = a || []; for(var p in o) { a.push(p); } return a; }
func.caller 返回函数调用者
function callfunc() { if(callfunc.caller) { alert(callfunc.caller.toString()); }else { alert("没有函数调用"); } } function handleCaller() { callfunc(); } handleCaller();//返回 handler callfunc();//没有函数调用,返回null,执行了《没有函数调用》
匿名方法递归调用
alert( (function (x) { if (x <= 1) return 1; return x * arguments.callee(x - 1); }(10)));//362800
JavaScript 工作必知(九)function 实参和形参
标签:
原文地址:http://www.cnblogs.com/fandong90/p/5554237.html