Computer choice part 2


This message appears every time: SyntaxError: 'return' statement outside of function

Replace this line with your code. 
var userChoice = prompt("Do you choose rock, paper, or scissors?")
var computerChoice = Math.random()
if (computerChoice <= .33) {
    return computerChoice = "rock";
} else if (computerChoice >= .34 && computerChoice <= .66) {
    return computerChoice = "paper";
} else {
    return computerChoice = "scissors";


move this print statement over to the line after the bracket it should be the last line of that excercise


I'm still getting the same error


And also, remove all the return's that come before your value assignments.

That should fix the error. :slight_smile:


That worked. Thanks!


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