Created
December 5, 2011 14:18
-
-
Save phoetry/1433713 to your computer and use it in GitHub Desktop.
Array.prototype.indexOf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].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 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].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