Skip to content

Instantly share code, notes, and snippets.

@mauriciosoares
Created June 10, 2014 21:08
Show Gist options
  • Save mauriciosoares/e8fd94d03a7132923e4c to your computer and use it in GitHub Desktop.
Save mauriciosoares/e8fd94d03a7132923e4c to your computer and use it in GitHub Desktop.
// can be used for browsers that doesn't have "bind" implemented
if(typeof Function.prototype.bind === 'undefined') {
Function.prototype.bind = function(thisArgs) {
var slice = Array.prototype.slice,
args = slice.call(arguments),
fn = this;
return function() {
return fn.apply(thisArgs, args.concat(slice.call(arguments)));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment