Hello everyone, so I’m having a bit of a problem with the Rock, paper, scissors game. Below is my code and at the end of it I expect to have ‘Rocks’ as my User input but i keep getting ’ Error!, Undefined ’ no matter what i input. What am i doing wrong?
I’m thinking the value of userInput sholud be either ‘rock’ , ‘paper’ or ‘scissors’ . If its not then it should prinT ‘Error’ . Isn’t that the purpose of the ‘if’ statement?
you forgot to call/invoke the toLowerCase function, so your variable now held the function itself, and not the returned result of the functions execution