What if choice 1 is paper assistance


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

Please help. I am having a difficulty finding my error in the coding.
<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>
I keep getting a syntax error.

```

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

<do not remove the three backticks above>

#2

Check your else if
Syntax for if / else if / else should be like this:

if (condition1) {
    //something
} else if (condition2) {
    //something
} else {
    //something
}

JS glossary - CodeCademy


#3

You’re missing a few brackets, don’t forget when you’re making a else/else if/if statement to take these with you " { } "
I’ll post my code so you can see what I’m talking about, might be simpler.
Here’s the correct 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 “scissors wins”;
}

    }

};