4 Computer Choice Part 2. Please Help!


#1


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


It says I have a, SyntaxError: Unexpected token else, but i don't what I did wrong


var userChoice=prompt("Do you choose rock, paper, or, scissors?");
var computerChoice=Math.random();
if (computerChoice<=.33)
{
    computerChoice==="rock";
    console.log("Computer choose rock");
};
else (computerChoice>=.34 && computerChoice<=.66)
{
    computerChoice==="paper";
    ("Computer choose paper");
};
else if (computerChoice>=.67 && computerChoice<=1)
{
    computerChoice==="scissors";
    ("Computer choose scissors");
};


#2

else doesn't take a condition.

when closing if remove the semi colon from after the bracket }; should be }


#4

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