Currently, I am working with an array:
var something = ["1","2","3","4"] ;
My plan is to prompt the user to select a number. If the chosen number matches any value in the array, I want to trigger a specific action.
Here's my dilemma: How can I verify if the user's input matches any value within the array?
if(something === "input"){
console.log("Good choice!");
}
Obviously, the current if statement I have won't work. How can I make it check each value in the array to see if there is a match?
It would be fantastic if someone could assist me with this issue! ;)
Thanks in advance!