Need help in Computer Choice: Part 2 - Unexpected Identifier


#1



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

https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/4?curriculum_id=506324b3a7dffd00020bf661


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";
};


#2

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


#3

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.


#4

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