Skip to content

Instantly share code, notes, and snippets.

@amalantony
Created February 12, 2017 07:56
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 amalantony/fad5af88f8bc76fcd03439cd520221a7 to your computer and use it in GitHub Desktop.
Save amalantony/fad5af88f8bc76fcd03439cd520221a7 to your computer and use it in GitHub Desktop.
Function.prototype.bind implementation.
Function.prototype.bind = function() {
var args = Array.prototype.slice.call(arguments);
var context = args.shift();
var fn = this;
return function() {
fn.apply(context, args.concat(Array.prototype.slice.call(arguments)))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment