Need help in Computer Choice: Part 2 - Unexpected Identifier


I got stuck in this exercise and looked around for nearly an hour - couldn't find my mistake.

The message is:
SyntaxError: Unexpected identifier

var userChoice = prompt("Do you choose rock, paper or scissor?");
var computerChoice = Math.random();
if (computerChoice <= 0.33) {
    computerChoice = "rock";
} else if (computer Choice < 0.67) {
    computerChoice = "paper";
} else {
    computerChoice = "scissor";


There is one semicolon ( ; ) too much, can you spot it?


No, sry. I can't see it. I have used two semicolons to end my var-lines, three semicolons to end the lines in the condition blocks and one final semicolon at the end of the whole if-block. I don't think one of them is in the wrong place and I just tried to delete ever single one, but it would'nt help. Still the same error.

Edit: I found the space in the else if-condition. It took me a whole day to find this... Wow.


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