0

Is there a better way? I have added the following to the String.protoype:

// str.whereIn(['cat', 'dog, 'mouse']);

String.prototype.whereIn = function(stringArray){
    var a = stringArray.indexOf(this.valueOf());
    return a>-1;
};
cweiske
  • 28,704
  • 13
  • 124
  • 186
ssoward
  • 540
  • 5
  • 9

0 Answers0