Getting : SyntaxError: Unexpected token ILLEGAL!


What if Choice 1 is Rock?

It says "SyntaxError: Unexpected token ILLEGAL" in the browser to the right, and after I hit submit, I get a "There was a problem with your syntax" below...

Could anyone help me out with fixing this code? Thank you so much!

var compare = function(choice1, computerChoice) {
    if (choice1 === computerChoice) {
        return "The result is a tie!";
    else if (choice1 === "rock") {
        if (computerChoice === "scissors) {
            return "Rock wins!";
    else {
        return "Paper wins!";
} ;


you forgot the closing " for scissors in if (computerChoice === "scissors) {


Thank you so much! Er... I'm getting an "Unexpected end of input" error now.

Could you please help again?


Thank you thebelegian1! It seems that I missed a } at the end.




This topic was automatically closed after 24 hours. New replies are no longer allowed.