Rock Paper Scissors: Computer Choice Help


I keep getting the error code: "Missing Before Statement". I am not sure what I am doing wrong.

var userChoice = prompt("Rock, Paper, or Scissors?")
var computerChoice = Math.random ()
if (0<=computerChoice<=0.33) {
    computerChoice = "Rock";}
else if (0.33<computerChoice<=0.66) {
   computerChoice = "Paper";}
else (0.66<computerChoice<=1) {computerChoice = ("Scissors") }
console.log (computerChoice)


Else statements don't take conditions. They will execute when previous if/else if conditions haven't been met.

The parentheses around Scissors, do you need them?


Thank you! That fixed the problem.


Glad it worked out :slight_smile:


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