#4 Computer choice part 2


#1


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};


#2

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


#3

Ahahh yeah right Thanks


#4

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