Help! 4. Build "Rock, Paper, Scissors"


#1

So, I have been staring at this code for almost 30 minutes now and I can't figure out what's wrong with it! I keep getting the syntax error "Unexpected end of input"

Here's the code:

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

see anything wrong with it?


#2

I believe you're missing a closing bracket at the end of your code. " } "


#3

so, it needs 3 closing brackets? There are already 2 there..


#4

nice, that worked.. I guess I didn't count my opened brackets then oops