Paper, Rock and Scissors: What is wrong with this piece of code?


#1

Hey guys, I'm really new to coding and I'm trying to learn JavaScript here in CodeCademy. I know there's something wrong with this piece of code (since the rest is automatically turned in a comment in this part of the exercise), but I'm not being able to find out what. Can some of you have a look?

var compare = function(choice1, choice2) {
if (choice1 === choice2) {
return "O resultado é um empate!";
}
else if(choice1 === "pedra") {
if(choice2 === "tesoura") {
return "pedra vence";
}
else {
return "papel vence";
}
}


#2

The function body is not closed. Add }; to very end.


#3

Ooh thank you. It's such a dumb thing geez.


#4

__it happens. Go easy on yourself.