I am using Javascript, and I'd like to make one IF statement that will check one variable against multiple strings using the least amount of code as possible. This is what I used:
if (string == "1" || string == "2" || string == "3" || string == "4") {
console.log("This should execute when string is 1, 2, 3, or 4");
}
How would I go about this same thing with the least amount of code as possible? I am using Javascript.