Skip to content

Instantly share code, notes, and snippets.

@docteurklein
Created February 23, 2011 09:01
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 docteurklein/840195 to your computer and use it in GitHub Desktop.
Save docteurklein/840195 to your computer and use it in GitHub Desktop.
Function.prototype.bind = function(context) {
if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
var __method = this, args = slice.call(arguments, 1);
return function() {
var a = merge(args, arguments);
return __method.apply(context, a);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment