Hi, i’m working on the rock, paper, scissors exercise and i’m not sure why this code is wrong (i know it’s coming from the if expression) :
console.log('hi');
const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput === "rock", "paper", "scissors") {
return userInput;
}
else {console.log("Error");
}
};
console.log(getUserChoice("table"));
So here the answer is to use || between each argument in the if but i don’t understand why writing the if like i did is wrong.