Rock Paper Scissors. Part 6


What did i do wrong lol please help.

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 block/body is not closed by }
also you need to close your function body too.

The number of closing { should be equal to number of }.
also they appear in symmetric order ({ comes with } to delimit any block of code.)


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