How do I check if a variable is equal to any element of an array?
var myButton = document.getElementById("myButton");
var myVar; //myVar value is set to "One", "Two" or "Three" sometime later
myArray = ["One","Two","Three"];
myButton.onclick = function () {
if (myVar === myArray) {
alert ("it's a match!");
} else {
alert ("it's not a match!");
}
};