Paper, rock, scissors: I need help with my code


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

I don't know where I got it wrong. I keep getting the oops something wrong with your syntax


i see two problems with your code, the first one is here:

else if(0.33<= computerChoice <= 0.66)

you can't do this, you need to do:

else if(condition1 && condition2)

and after else there shouldn't be (), else is simple everything else, so this is enough:

else {}


@stetim94 thanks for your help. after removing the ''()'' the code ran, even with the (0.33<= computerChoice <= 0.66).