Array.indexOf does not work in Internet Explorer...So make it!

While trying to do an indexOf on a Javascript array I created [arrayName.indexOf("joe")] I discovered that it wouldn't work in Internet Explorer! IE does not support this method for array's! So A quick search on the web lead me to soledad penadés web site where I discovered a simple solution. All you have to do is add the following chunk of code to your script with no modifications and it will force Internet Explorer to function properly! How cool is that!

  Array.prototype.indexOf = function(obj){
   for(var i=0; i<this.length; i++){
     return i;
   return -1;

By Colin Pear, 6/10/2007 -- Back to Java Script Tutorials ans lessons learned.

Works Cited: — 6/10/2007