const string=getString(); const allowedValues=['Test','Dev','etc.']; if(allowedValues.indexOf(string)>=0) //do something