computerChoice part 2


#1

Can someone please help with this SyntaxError : unexpected token?

var userChoice = prompt(" Do you choose rock, paper, or scissors?")
var computerChoice = Math.random(0,1) ;

if( 0 <=computerChoice <=0.33){
computerChoice = "Rock" ;
} else if(0.34<= computerChoice <=0.66){
computerChoice = "Paper" ;
} else (0.67<= computerChoice <=1){
computerChoice = "Scissors" ;
}
console.log(computerChoice)


Unexpected token - SyntaxError
#2

else can't have a condition since it is everything else


#3

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