#4 Computer choice part 2


It gives me syntax error "Illegal return statement"
var userChoice=prompt("Do you choose rock,paper or scissors?")
var computerChoice=Math.random() 
console.log (computerChoice);
if (computerChoice <=0.33){return rock};
else if (computerChoice >0.33 && computerChoice <0.66){return paper};
else (computerChoice >0.67 && computerChoice <1){return scissors};


HI your if, else if and else statement should not return but set a new value to compareChoice


Ahahh yeah right Thanks


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