Help with finding values in arrays

Is there a simple way to ask “Does this array contain this value?”

For example I have an array1 [0,2,4,6,8,10] and another array2 [1,3,5,7,9]. I want to say something like:


if (array1 contains "3") {
//do something
} else if (array2 contains "3") {
//do something else
}

In this case of course it would find the value “3” in array2 and then do the appropriate action specified there.

Possible?