I need help as my syntax is having a problem but I'm not sure what it is


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


The return keyword is only used inside function implementation but not outside. So in your if/else if/else block(which is not in a function) you rather have to set computerChoice to whatever you are returning