Computer Choice Part 2>>>PLEASE HELP ME


#1

var userChoice = prompt("Do you choose rock, paper, or scissors?")

var computerChoice = Math.random()
console.log(computerChoice)

if (computerChoice <= 0.33){
computerChoice = "rock"
} else if (computerChoice === 0.34 && computerChoice <= 0.66){
computerChoice = "paper"
} else (computerChoice === 0.67 && computerChoice <= 1){
computerChoice = "scissors"
}

Please can anyone see what's wrong with my code?


#2

You don't need to specify a condition for else. It's just simply else.


#3

I found that there is usually a syntax error when you specify else in an if else statment. @syntaxity


#4

I figured that put. Thanks. Can you check my latest thread?


#5

Okay, whats it called please?


#6

Your Second "for" loop>>>>ASSIST


#7

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