Exercise 7 keeps saying syntax error


#1


stuck on exercise 7 what am i doing wrong


keeps on saying unexpected token ';'
and expected opening '{' at the start of a function body


Replace this line with your code. 

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"; 
        }
    }
    else if (choice1 = "paper") {
        if(choice2 === "rock") {
            return("paper wins");
        }
        else {
            return("scissor wins");
        }
    }


#2

HI just add one } at the end for closing the compare function and.... here remove the ;

var compare = function (choice1, choice2); <--

#3

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