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
  • 30,033
  • 14
  • 133
  • 194
ssoward
  • 540
  • 5
  • 9

0 Answers0