I have had a few problems with ‘else’ statements. In conditional setups the “else” statement does not work, however, the elseifs do. Example: I am getting an error message here that there is an unexpected else token. Here the else should statement should show the console message.
const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput === ‘rock’ || userInput === ‘paper’ || userInput === ‘scissors’ )
return userInput;
}
else{
console.log(“There is an error”);
};
console.log(getUserChoice(‘fork’));