What if choice 1 is "scissors"


#1

Can someone please tell me what I am doing wrong here. I keep getting the Error "Unexpected keyword 'else'"
I've been looking at this code for a while and I can't figure out whats wrong with it. thanks!

else if(choice1 === scissors) {
if(choice2 === "rock") {
return "rock wins"
}
}
else {
return "paper wins"
}
}
compare(userChoice, computerChoice);


#2

Misplaced curly brace. Move one to the bottom so it closes the compare() function body.

should be written as a string, "scissors".


#3

ok, I changed my code and it still is giving me the same error message. I'm pretty sure it's my curly brackets, I just don't know what.
else if(choice1 === "scissors") {
if(choice2 === "rock") {
return "rock wins";
}
else {
return "paper wins";
}
}
compare(userChoice, computerChoice);


#4

Post your entire compare() function, please.


#5

A post was split to a new topic: Please help