Building Rock Paper Scissors 6 Problems


#1

I am 13 years old and I started learning to program when I was 11 years old, but I stopped. But now, I am starting back up again, and I don't see why it isn't working. On number 6 of rps (rock, paper, scissors) my code is this:

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

}

Heck, I copied and pasted the bottom part from the hint, even though the programming in the hint was nearly identical to mine! So I don't understand why there is any issue. It says that there was a problem with my syntax. Please help.

(It is starting to tick me off how they don't show you where the problem is anymore. Every other place I try, the highlight the line with the mistake, but apparently they don't do this, but I remember codecademy doing this about a year ago.


#2

Put another curly bracket at the end and it should work


#3

Thank you! That helped a lot!