Function.prototype.bind = function(){
var fn = this, args = Array.prototype.slice.call(arguments), object = args.shift();
return function(){
return fn.apply(object,
**args.concat(Array.prototype.slice.call(arguments))**);
};
};
此函数在Prototype中。它等于:原型“绑定”方法问题
Function.prototype.bind = function(){
var fn = this, args = Array.prototype.slice.call(arguments), object = args.shift();
return function(){
return fn.apply(object,**args**);
};
};
在我看来,args.concat(Array.prototype.slice.call(arguments)) == args
,因为匿名 功能没有任何参数。有什么事?