想參照老師的代碼打一下,看看arugments,結果提示SyntaxError: Unexpected token this,跪求解決
function?foo(){ ??this.b=100; ??retrun?this.a; } var?func=foo.binddd({a:1}); Function.prototype.binddd=function(oThis){ ??var?aArgs=Array.prototype.slice.call(arguments,1); ??fToBind=this; ??fNOP=function(){}; ??Bound=function(){ ????return?fToBind.apply(this?instanceof?fNOP?this:oThis,aArgs.concat(Array.prototype.slice.call(arguments))); ??} ??fNOP.prototype=this.prototype; ??fBound.prototype=new?fNOP(); ??return?fBound; }; func(); new?func();
2016-11-30