//主接口win.laydate = function(options){
options = options || {}; try{ as.event = win.event ? win.event : laydate.caller.arguments[0];
} catch(e){};
Dates.run(options); return laydate;
};这个laydate.caller.arguments[0]啥意思?
1 回答

慕哥9229398
TA贡献1877条经验 获得超6个赞
调用 laydate 函数的函数的第一个参数。
function fun(a,b){ laydate(a+b); } function laydate(c){ // 调用 laydate 函数 的函数(fun) 的第一个参数(a)。 console.log(laydate.caller.arguments[0]); console.table([laydate.caller.arguments,arguments]); }fun(1,2);
直接写 函数名(laydate)不优雅,后期函数改名后都要改,可以用callee,最终实现的效果都是一样的。
function fun(a,b){ laydate(a+b); } function laydate(c){ console.log(arguments.callee.caller.arguments[0]); }fun(1,2);
添加回答
举报
0/150
提交
取消