I wanted to try using the !== conditional. Why does this code log 'Invalid choice' and undefined?
const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput !== 'rock' || userInput !== 'paper' || userInput !== 'scissors') {
console.log('Invalid choice');
} else {
return userInput;
}
};
console.log(getUserChoice('paper'));
I wanted to try the !== instead of === if statement for a rock paper scissors game. Is the issue syntax or logic?