I keep getting illegal return statement


#1

I keep getting illegal return statement. Can someone tell me what is wrong with my return statement(s)? Thank you in advance.

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.66) {
return "paper";
} else {
return "scissors";}


4. Computer Choice: Part 2 help!
#2

Hi here

if (computerChoice <= 0.33) {
return "rock";
} else if (computerChoice <= 0.66) {
return "paper";
} else {
return "scissors";}

Instead of using return you should use computerChoice like that in the first case computerChoice = "rock" do the same for the others