Javascript String matchesAny(list)

Description

Javascript String matchesAny(list)


//if matches to any of the strings - case sensitive
String.prototype.matchesAny=function(list){
 var isMatched = false;
 if(list){/*from w w  w  . java 2 s .co  m*/
  list.forEach(function(element){
   if(element === this.toString())
    isMatched=true;
  }.bind(this))
 }
 return isMatched;
}



PreviousNext

Related