Need help on step 6: Unexpected Else


So I was on part 6 of the Rock Paper Scissors and it keeps giving me "SyntaxError: Unexpected token else". I have looked on other threads but none of them are solving my problem.

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 (choice2 === "paper") {
          return "paper wins";


; after if codition is a bad idea

if (choice1 === choice2); // remove ;


//block of code


else doesn't have condition


Thank you very much.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.