Posted By

toddaeverett on 03/16/10


Tagged


Versions (?)

create "array.indexOf" function in IE


 / Published in: JavaScript
 

  1. // create "Array.indexOf" function in IE
  2. if(!Array.prototype.indexOf){
  3. Array.prototype.indexOf=function(obj,start){
  4. for(var i=(start||0),j=this.length;i<j;i++){
  5. if(this[i]==obj){return i;}
  6. }
  7. return -1;
  8. }
  9. }

Report this snippet  

You need to login to post a comment.