6/9 Syntax error, HELP PLS


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


#2

Another bracket at the end of your code.

  1. One bracket from the end of function
  2. One bracket from the else if statement
  3. One bracket from the else statement

#3

Ahhh Omigod I love you, thanks!


#4

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

// why don't work?????


#5

Why don't you try refreshing? Seems like that would make it work :smiley: