Problem using 'prompt' command to define userInput function


It’s okay. I figured out what’s wrong. When I set the userInput variable to be defined by a prompt, I forgot to add .toLowerCase(); to the end of the command. When the prompt box came up asking my to choose rock, paper or scissors, I was typing my choices with an upper case first letter (ie ‘Rock’ rather than ‘rock’ - force of habit) and the program couldn’t recognise it. Now I’ve added the .toLowerCase(); modifier it works fine :slight_smile:


Hi @neilmurrell,

Can you post your full code with the formatting here?
So we can have a look and test it.

Hope to hear from you soon. :slight_smile:


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