6. what if choice 1 is rock?


I need help with this exercise. I have no idea how it's wrong

Here's my link: https://gist.github.com/8b212759a23b7ce31cf6bff6e0f19114

The error it's showing me is: SyntaxError: Illegal return statement

if(choice1 === choice2) {
    return "The result is a tie";

else if(choice1 === "rock") {

    if(choice2 === "scissors") {
        return "rock wins";
    else {
        return "paper wins";




Where is your compare function? Go back over the instructions. You shouldn't have deleted those lines of code from the previous lesson.


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