Skip to content

Instantly share code, notes, and snippets.

@phoetry
Created December 5, 2011 14:18
Show Gist options
  • Save phoetry/1433713 to your computer and use it in GitHub Desktop.
Save phoetry/1433713 to your computer and use it in GitHub Desktop.
Array.prototype.indexOf
[].indexOf||(Array.prototype.indexOf=function(a,b,t,l){
for(t=this,l=t.length,b=(b=b|0)<0?l+b:b;i<l;i++)
if(t[i]===a)return i;
return-1
})
[].indexOf||(Array.prototype.indexOf=function(a,b,t,l){for(t=this,l=t.length,b=(b=b|0)<0?l+b:b;i<l;i++)if(t[i]===a)return i;return-1})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment