Skip to content

Instantly share code, notes, and snippets.

@toddmotto
Created April 17, 2014 07:28
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 toddmotto/10960869 to your computer and use it in GitHub Desktop.
Save toddmotto/10960869 to your computer and use it in GitHub Desktop.
ECMAScript 5 .bind() Polyfill
Function.prototype.bind = Function.prototype.bind || function (target) {
var self = this;
return function (args) {
if (!(args instanceof Array)) {
args = [args];
}
self.apply(target, args);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment