Computer Choice Part 2 Syntax


#1

Hello out there!
Could someone help me with syntax? I'm not sure what I'm doing wrong. :frowning:


#2

I think there shouldn't be a condition on the else and by that i mean you are not suppose to have () you should only have a result in {} my code is slightly different but it has worked.

else{
computerChoice="scissors";
}

full code is here below

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);