Help me : What if choice1 is paper?


#1

Help me solve this error code... which part is wrong?


#2

your function openings curly bracket ({) doesn't have a matching closing bracket


#3

I have add close bracket (}) in line 13, but problem is same...


#4

can you copy paste your code to the forum so i can actually run it? It is super difficult to debug from a image


#5

Here my code, please help me :frowning:

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

#6

this line:

if (choice2 === "rock");{

the semi-colon is wrong, it means the if statement never gets executed properly


#7

I have deleted it (semi-colon), but the result still same :

" SyntaxError: Unexpected end of input "


#8

given the fact that i already indicated what the problem was, why you got this error message, i thought you would be capable of resolving it


#9

ok, i try another way... thank you for instruction...