Javascript Array in(ele)

Description

Javascript Array in(ele)

Array.prototype.in = function(ele) {
 for (var i=0; i<this.length; i++) {
  if (this[i] == ele) {
   return true;/*  w w w  . ja  va2 s .com*/
  }
 }
 return false;
}



PreviousNext

Related