Skip to content

Instantly share code, notes, and snippets.

@qoobaa
Created March 28, 2012 09:35
Show Gist options
  • Save qoobaa/2225053 to your computer and use it in GitHub Desktop.
Save qoobaa/2225053 to your computer and use it in GitHub Desktop.
var rbind = function (context) {
var fn = this,
slice = Array.prototype.slice,
xargs = slice.call(arguments, 1);
return function () {
var args = slice.call(arguments).concat(xargs);
return fn.apply(context || fn, args);
};
};
Function.prototype.rbind = rbind;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment