Skip to content

Instantly share code, notes, and snippets.

@shishirarora3
Created November 11, 2018 23:50
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 shishirarora3/f64bf2669ece2bc63f70ab3b43aef747 to your computer and use it in GitHub Desktop.
Save shishirarora3/f64bf2669ece2bc63f70ab3b43aef747 to your computer and use it in GitHub Desktop.
if(!('bind' in Function.prototype)){
Function.prototype.bind = function() {
var fn = this;
var context = arguments[0];
var args = Array.prototype.slice.call(arguments, 1);
return function() {
return fn.apply(context, args.concat([].slice.call(arguments)));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment