6/9 Not sure what's wrong


#1

It keeps saying there's something wrong with the syntax. I've checked and double checked, but I can't find what's wrong.

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

I don't see a parentheses after this...

And there's this.... but....

You need another bracket at the end somewhere.


#3

Thanks for the help. I ended up retyping the whole thing and it seems to have worked.


#4

please help.
i dont know whats 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";
}
};


#5

Nevermind. figured out my mistake.


#6

whats wrong with mine

if(choice1 === choice2); {

    return "The result is a tie!";
}
else if(choice1 ==="rock") {

    if(choice2 === "scissors") {

        return "rocks win"; 
    }

    else {

        return "paper wins";
    }
}

}


#7

No SEMI COLONS after an if statement.


#8

here is my code

compare = function(choice1, choice2) {

if(choice1 === choice2); {

    return "The result is a tie!";
}

else if(choice1 ==="rock") {

    if(choice2 === "scissors") {

        return "rocks win"; 
    }

    else {

        return "paper wins";
    }
}

}


#9

with all the changes it still produces an error

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

}


#10

PLEASE LISTEN TO HELP, FOR YOU HAVE NOT MADE ANY CHANGES THAT I HAVE SAID