SyntaxError: Unexpected string -- I need help finding & explaining syntax error


SyntaxError: Unexpected string

var userChoice = prompt("Do you choose rock paper or scissors?");
var computerChoice = Math.random();
    if (computerChoice <= 0.33) {
    computerChoice "rock";
    } else if 
       (computerChoice <= 0.66) {
        computerChoice "paper";
    } else {
        computerChoice "scissors"; }

What have I done wrong?


the purpose of your if/else if/else statement is to give the computerChoice a new value (rock, paper or scissors), you do need a equal sign between the variable name and the string to assign a string to a variable:

computerChoice = "rock"


thank you @stetim94
i spent an hour trying to figure this out