5Oct/090
Javascript Array.indexOf
The indexOf sometimes is extremely useful function that is used to get the index of an element in an array. This function is not implemented in Internet Explorer (IE). A simple implementation to this function can be as:
if(!Array.indexOf){
Array.prototype.indexOf = function(obj){
for(var i=0; i < this.length; i++){
if(this[i]==obj){
return i;
}
}
return -1;
}
}
Another advanced implementation is introduced by Mozilla here.