Computer Choice: Part 2 Syntax error


#1


I'm getting a syntax error saying that there is an unexpected keyword: else. I'm pulling my hair out over it. Any suggestions?


var computerChoice = Math.random()


    console.log(computerChoice);
    
    if (computerChoice <= .33);{
        computerChoice = "rock";
    }
    else if (computerChoice <= .66) {
        computerChoice = "paper";
    }
    else (computerChoice > .67){
        computerChoice = "scissors";
    }


#2

If I'm not wrong, else's do not necessarily need parentheses

If I'm not wrong, you should put 0.34, and it should be only smaller than, not smaller and equal to. Also, it has a semicolon at the end of the parentheses, remove it.

This goes after everything, and it should log it like so:

console.log("Computer: " + computerChoice);

`

Again, it's 0.67.`


#3

Actually, an else cannot have a parameter/parentheses.

Everything you have said, @zolated, is correct, except:

The <= is actually correct.


#4

I just had the same problem and rewrote the code an embarrassing amount of times until I realized the missing semicolon after Math.random()...