What if choice 1 is paper?


#1

I cannont find the error :frowning:

introduction ===============
01. Inside the compare() function under the existing code,
write another else if statement where the condition is choice1 === "paper".
02. Inside this else if statement, write an if / else statement.
If choice2 === "rock", return "paper wins". Else, return "scissors wins".

error =================
Oops, try again. There was a problem with your syntax.

my code ===============

var compare = function(choice1, choice2) {
if (choice1 === choice2) {
return "The result is a tie!";
} else if (choice1 === "rock") {
if (choice2 === "scissor")
return "rock wins";
} else {
return "paper wins";
}
} else if (choice1 === "paper") {
if (choice2 === "rock") {
return "paper wins";
} else {
return "scossors wins";
}
}
}


#2

here:

if (choice2 === "scissor")

missing { to mark beginning of if statement

and spell scissors correctly (you wrote scossors)


#3

Thanks :smiley:
I found the error and fixed it.


#4