87,907
社区成员
发帖
与我相关
我的任务
分享
Array.prototype.slice.call(arguments, 1)
var methods={
a1 : function(a,b){
var $a = a;
var $b = b;
},
a2 : function(){
var $a = arguments;
}
}
var fn=function(fun){
if(methods[fun]){
return methods[fun].apply(this, Array.prototype.slice.call(arguments, 1))
}
}
fn(a1,'x1','x2');
fn(a2,'xx1','xx2','xx3');
var methods={...}
var fn=function(fun){
if(methods[fun]){
return methods[fun].apply(this, Array.prototype.slice.call(arguments, 1))
}
}