6.What if choice1 is rock?


#1

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

<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.>

```

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

It says “There was a problem with your syntax”. I can’t find my error. please help!

<do not remove the three backticks above>

#2

HI this part

if ("choice1===choice2")

you should remove the " "… then here you should add one } for closing the compare function

else if (choice1 === "rock") {
  if (choice2 === "scissors") {
    return "rock wins";
  } else {
    return "paper wins";
  }
}
} <= add one here 

#3

It works!!! Thank you very much.