Skip to content

Instantly share code, notes, and snippets.

@gryzzly
Created April 4, 2012 14:21
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 gryzzly/2301514 to your computer and use it in GitHub Desktop.
Save gryzzly/2301514 to your computer and use it in GitHub Desktop.
Basic Function.bind
// naïve bind implementation
Function.prototype.bind = function () {
var obj = arguments[0], args = [].slice.call(arguments, 1);
return function () {
this.apply(
obj,
[].concat.call(args, [].slice.call(arguments))
);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment