Help plz i dont know what i shoud do


#1

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


#2

What error did you get for this lesson?


#3

Misspelled computer!


#4

ah yes so instead of computrerChoice you need computerChoice so basically respell computer everywhere its misspelled


#5

Oops, try again. There was a problem with your syntax.


#6

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.66){
computerChoice = "paper";}
else (computerChoice<=1){
computerChoice = "scissors";
}

give me the same Oops, try again. There was a problem with your syntax.


#7

Remove the condition from your else statement. Else statements don't take a condition since they only execute when prior if or else if statement conditions aren't met.


#8

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