Please help 6/9


#1

Can't seem to find what is wrong here. Please help. True beginner indeed. :weary:

var compare = function (choice1, choice2) {
if (choice1 === choice2) {
    return "The result is a tie!" ;
} else if (choice1 === "rock") {
    if (choice2 === "scissors") {
        return "rock wins" ;
    } 
    else {
        return "paper wins";
    }
}

#2

seems like your missing a } at the very end to close the function. The rest seems to be ok but you could add another level of indentation for the function:

var compare = function (choice1, choice2) {
    if (choice1 === choice2) {
        return "The result is a tie!" ;
    } else if (choice1 === "rock") {
        if (choice2 === "scissors") {
            return "rock wins" ;
        } 
        else {
            return "paper wins";
        }
    }

Now it could be easier to see where the } is missing.


#3

Thank you so much for the help. :smile: