4. computer choice part 2


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

if (computerChoice <= 0.33){
    computerChoice === rock;

else if (computerChoice <=0.66){
    computerChoice === paper;

    computerChoice === scissors;

i can't get it working please help


you should set the computerChoice to rock, paper or scissors (using a single equal sign)

rock, paper and scissors are strings, don't forget to use quotation marks (") when dealing with strings


Thanks for the help it worked


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