Is it possible to test a variable against a specific/all possible values within an array? For instance, if I have:
var abc;
var array1 = ["item1", "item2", "item3"];
function someFunction(){
abc = "item2"
if (abc == !!**Either array1[item1] OR array1[item2] OR.. etc for x in array1**!!)
{
//*do stuff*
}
}
What is the correct syntax for testing abc
against any possible entry in array1
?