6/9 Syntax error


#1

I don't understand what's wrong

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


#2

there are 4 equal signs not 3 .


#3

Thanks! Fixed that but it still says error. It says expected } but I thought there was enough curly brackets


#4

var compare = function (choice1, choice2) { ( 10 )
if (choice1 === choice2) { (2)
return "The result is a tie!";
} (2)
else if (choice1 ==== "rock") { (5)
if (choice2 === "scissors") { (3)
return "rock wins";
} (3)
else { (4)
return "paper wins";
} (4)
} (5)
} (10)

yes, it is needed one more } .


#5

Ok I get it. Thanks for your help!