Skip to content

Instantly share code, notes, and snippets.

@liujiangfeng
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liujiangfeng/c13f1c140edfbee75179 to your computer and use it in GitHub Desktop.
Save liujiangfeng/c13f1c140edfbee75179 to your computer and use it in GitHub Desktop.
bind.js
if( !Function.prototype.bind ){
Function.prototype.bind = function( obj ){
var args =[], that = this;
if( arguments.length > 1){
args = [].slice.call(arguments , 2);
}
return function (arg){
return that.apply( obj , args.cancat([].slice.call.arg));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment