Javascript Array contains(e,ignore)

Description

Javascript Array contains(e,ignore)



Array.prototype.contains  = function(e,ignore)  {  
 if(ignore==undefined) ignore = false;
    for(var i=0;i<this.length;i++){  
  if(ignore){/*from  ww w. j  ava  2  s. c o  m*/
   if(this[i].toLowerCase() == e.toLowerCase()) 
    return true; 
  }else{
   if(this[i] == e) 
    return true; 
  }    
    }  
    return false;  
}



PreviousNext

Related