I've been trying to create an array which will hold a set of numbers. In this case 10, 33, 55 and 99. What I'm looking for is something flexible to search the array for a variable to see if the number is in it.
var nrArray = [10, 33, 55, 99]; // Any number in this array will decide the function below
if ( 55 = nrArray ) { // If the number 55 is in the array do the following
document.getElementById("demo1").innerHTML = "RUN1";
}
else { // If the number 55 does not exist in the array do the following
document.getElementById("demo2").innerHTML = "RUN2";
}
<p id="demo1">demo1</p>
<p id="demo2">demo2</p>
NOTE 55 in this example will be replaced with a variable that has a number set to it. And this number will vary