Skip to content

Instantly share code, notes, and snippets.

@partynight12th
Created August 19, 2012 03:41
Show Gist options
  • Save partynight12th/3391670 to your computer and use it in GitHub Desktop.
Save partynight12th/3391670 to your computer and use it in GitHub Desktop.
Function.prototype.bind at JavaScript for MobileSafari
if(!Function.prototype.hasOwnProperty("bind")){
Function.prototype.bind = function(){
var func = this;
var t = arguments[0];
var len = arguments.length;
var newargary = [];
for(var i = 1; i < len; i++){
newargary.push(arguments[i]);
}
return function(){
return func.apply(t, newargary);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment