I have no idea what is wrong in this code




var userChoice = prompt("Do you choose rock, paper or scissors")
var computerChoice = Math.random();
console.log (computerChoice)

if (0 < computerChoice < 0.33) {
else if (0.34 < computerChoice < 0.66) {
else (0.67 < computerChoice){
    console.log (scissors)   


if you want to do multiply comparison, you should use a and (&&) or or (||) operator, but you don't have to. You can just check for values less then .34 in your if conditions, lesser then .67 in your else if (don't check the number is bigger then .34, if it would have been smaller if runs, and then else if will never run)

Else can't have a condition at all


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