What if choice 1 is rock?


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

What am I doing wrong? Been stuck with this one for too long D:


#2

It says "SyntaxError: Unexpected end of input"


#3

your else if statement is not closed


#4

What do you mean by not closed???


#5

There are 2 closing } at the end, one for else one for else if and there would be need of a third one to close the function. as {} always come in pairs one to open and one to close.