6.What if choice1 is rock?


#1



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!


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