What if choice 1 is rock?


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:


It says "SyntaxError: Unexpected end of input"


your else if statement is not closed


What do you mean by not closed???


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.