Skip to content

Instantly share code, notes, and snippets.

@ryanburgess
Created January 2, 2014 05:44
Show Gist options
  • Select an option

  • Save ryanburgess/8215505 to your computer and use it in GitHub Desktop.

Select an option

Save ryanburgess/8215505 to your computer and use it in GitHub Desktop.
A fix for IE not supporting indexOf on an array.
if(!Array.indexOf){
Array.prototype.indexOf = function(obj){
for(var i=0; i<this.length; i++){
if(this[i]==obj){
return i;
}
}
return -1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment