RockRock, paper and scissors


#1

I need help. I am Brazilian, so the code is in Portuguese.
I wrote the code and analyzed according to the tip and it's all right, but appears to me, "SyntaxError: Unexpected end of input" and I can not find where the error is. I made all the changes that I thought I could be wrong, but it keeps popping up that has an error and tip sends write the code exactly like this. I looked at the answers here and still could not find it, would you help me, please

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

}


Section 6 "help"
#2

Hi @betynazimmaro,

Spacing can help a lot in this regard! :nerd: Check it out:

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

Can you see where the unexpected (missing) end of input is now?

frisby


PS: If you need another hint, check @danielsainz's tip again more closely :wink: