How can I compare a variable with each and every element of an array
var saludo = ["hi", "hola", "buenos dias", "buen dia"];
if(otraVariableX == saludo[]) {
alert("Hola!!!");
}
only the if
works for me if I specify the positions of the example array:
saludo[0]
saludo[1]
But I want it to be compared with all the elements of the arrangement, 4 in this case greeting [0-3]