Invalid Return


When I run this code( I replaced real comparisons with simple number comparisons to try to find problem) It says -Invalid return- I ran it through a code checker and it told me my return statements were illegal- how do i fix it

var userChoice = prompt("Do you choose rock, paper, or scissors?");

var computerChoice = Math.random();


if (0===0) {
} else if (0===3) {
} else {


Get rid of the return. Return is a keyword used in function to return from the function to the calling scope or to return by also returning a value. It has nothing to do outside of the context of functions as their is no sub scope from which you could return (you are already on top level). Rather assign the value to your computerChoice variable.