The game: Whats wrong with my code?


#1


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


#2

Assignment should be on same line.


#3

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