For values in array

Hello,
While making my script i ran into a problem. i need to check for the array values 0,1,2.
Like this

if(mountainsTF == true && (x - mountainX[])){

Where mountainX is assigned a mountainX[0],mountainX[1],mountainX[2] values.

I would like to somthing like this,

x-mountainX[0-2]

but i dont think i cando that…

sorry im still learning Unityscipt(Javascript) and im sure theres an easy way to do this…

You can use the or operator ‘||’ like this:

if(mountainsTF == true && (x - mountainX[0]) ||  (x - mountainX[1]) || (x - mountainX[2])){

Sure, just use a for loop:

//UnityScript
//[...]
    var anyTrue = false;
    for (var i = 0; i < mountainX.Length; i++)
    {
        if (x - mountainX*)*

{
anyTrue = true;
break;
}
}
if(mountainsTF == true && anyTrue)
{
// […]
}
//[…]