Syntax error


#1


userChoice=prompt("Do you choose rock, paper or scissors?");
computerChoice=Math.random();
console.log(computerChoice);
if(computerChoice>0 && computerChoice<=0.33){
computerChoice="rock";
}
else if(computerChoice>0.33 && computerChoice<=0.66){
computerChoice="paper";
}
else(computerChoice>0.66 && computerChoice<=1){
computerChoice="scissors";
}

SyntaxError: missing before statement

Replace this line with your code.


#2

else can't have a condition


#3

you haven't declared "userChoice" neither "computerChoice"


#4

he has, see quote


#5

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