Skip to content

Instantly share code, notes, and snippets.

@ardeshireshghi
Created February 16, 2017 17:07
Show Gist options
  • Save ardeshireshghi/44d694ae0505f1af2df262fb65dd93df to your computer and use it in GitHub Desktop.
Save ardeshireshghi/44d694ae0505f1af2df262fb65dd93df to your computer and use it in GitHub Desktop.
Function.prototype.bind = Function.prototype.bind || function() {
var args = Array.prototype.slice.call(arguments);
var context = args[0];
var fn = this;
return function() {
var fnArgs = Array.prototype.slice.call(arguments);
fn.apply(context, args.slice(1).concat(fnArgs));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment