I am trying to create a code that activates when the user inputs a specific symbol or string. The issue is that it seems to be disregarding the if statements I have implemented.
Here is the challenge at hand: Develop a program that can determine the color of a chessboard square based on its Label and Rank. Input: On the first line, input L - the label On the second line, input R - the rank
let L = prompt();
let R = Number(prompt());
if (L == ("a", "c", "e", "g")) {
if (R % 2 == 0) {
/*if we are on a/c/e/g lines and the number is even the
square is white*/
console.log("light");
} else {
console.log("dark");
} //else it is going to be odd therefore dark
} else if (L == ("b", "d", "f", "h")) { //opposite logic:
if (R % 2 == 0) {
console.log("dark");
} else {
console.log("light");
}
}
The main issue I am facing is how to properly compare the two strings. I attempted utilizing various string methods, but it appears that I might be making a syntax error.