Help with rock.papper.scissors project

const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput === ‘rock’ || userInput === ‘paper’ || userInput === ‘scissors’) {
return userInput;
} else {
console.log(‘Error!’);
}
console.log(getUserChoice(‘Paper’));
console.log(getUserChoice(‘fork’));
};

not sure but for some reason whenever I write the code out the letters turn turquoise. I cant see what I’m doing wrong? or nothing happens when I run program to double check work ?

1 Like

Here you appear to be attempting to log the function to the console from inside the function, which is likely resulting in either an error or an infinite loop. Move these calls to be outside your function and it should work okay.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.