Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Function.prototype.bind Polyfill (Performace optimized:
* Polyfill for Function.prototype.bind
* (bind)[]
* (You don't need to use $.proxy)[]
* Credits: taken from bind_even_never in this discussion:
if (typeof Function.prototype.bind !== "function") {
Function.prototype.bind = function(context) {
var fn = this, args =, 1);
return function(){
return fn.apply(context, Array.prototype.concat.apply(args, arguments));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment