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


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?


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


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


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