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


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


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


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


__it happens. Go easy on yourself.