7. What if choice 1 is paper


#1



It seems like I have an extra { somewhere I'm getting a SyntaxError: Unexpected token {


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


#2

It would seem you have 6 } and 7 {. Also, like in your last else if statement, you have 3 { but only 2 } so maybe some deleting and reorganizing is in order :smiley:


#3

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