I don’t understand why my logic is failing. I’m returning the userInput by default and catching the errors. But when change the code to see if the userInput equals rock, paper, or scissors and return “wrong Input” by default it works fine. I feel like I shouldn’t be running into this issue. Can someone provide some clarity.
const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput != 'rock' || userInput != 'paper' || userInput != 'scissors') {
return 'Wrong Input';
}
return userInput;
}
console.log(getUserChoice('Paper'));