Step 7, cannot work out what im doing wrong


#1

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"
    }
}

}
else if (choice1 === "paper") {

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

}

Keeps giving me a syntax error, can somebody point out where im going wrong so I can work it out, I know its gonna be something stupid that I am just not seeing.


#2

no matter I figured it out. :smiley:


#3

I'm stuck on this part as well, my code is same as yours. what was the solution?

thanks!


#4

Probably a missing } to close the function.