search an array

admin

Administrator
Staff member
Is there a way to check if something is an element in an array?

Say:

a=4;
b= new Array(1,2,3,4,5,6);

Can i do something like:
if (a.elementOf(b)) {do this}

with out having to do a loop to check each element of the array?
 
Back
Top