SyntaxError: Unexpected token {


#1

Please can somebody tell me what is wrong with my code, cause I am not capable of seeing anything bad in it! :frowning:


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


var userChoice = prompt ("Do you choose Rock, Paper or Scissors?");
var computerChoice = Math.random();
console.log (computerChoice)
if (computerChoice >= 0 && computerChoice <= 0.33 ) {
    computerChoice = "Rock";
} else if (computerChoice >= 34 && computerChoice <= 0.66) {
    computerChoice = "Paper";
} else (computerChoice >= 67 && computerChoice <= 1) {
    computerChoice = "Scissors";
}


#2

Ok a normal If/elseif/else statement looks like this:

if(something == somethingElse){
/*Do Something*/
} else if(something == SomethingOtherElse){
/*Do Something else if*/
}
else{
/*Do Something that dosent meet any of these requirements*/
}

But you tend to have a condition on your else statement? That's your problem there: