bind 实现
(function () { var slice = Array.prototype.slice; Function.prototype.bind = function () { var thatFunc = this, thatArg = arguments[0]; var args = slice.call(arguments, 1); if (typeof thatFunc !== "function") { // thatFunc 应该为应该函数 throw new TypeError( "Function.prototype.bind - " + "被调用的应该为一个函数" ); } return function () { var funcArgs = args.concat(slice.call(arguments)); return thatFunc.apply(thatArg, funcArgs); }; }; })();