Javascript String matchesAnyCase(list)

Description

Javascript String matchesAnyCase(list)

//if matches to any of the strings -- case insentitive
String.prototype.matchesAnyCase=function(list){
 var isMatched = false;
 if(list){//  ww  w. j a v a  2 s  .  c o m
  list.forEach(function(element){
   if(element.toString().toLowerCase() === this.toString().toLowerCase())
    isMatched=true;
  }.bind(this))
 }
 return isMatched;
}



PreviousNext

Related