This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Swish786
over 8 years

Why am I getting an unexpected token (else)?

if(choice1 === choice2) { return “The result is a tie!”; } }; else if (choice1==”rock”){ return”Rock wins!” }; else{ return”Paper wins” };

Answer 55d7bc58e39efed7ea000601

1 vote

Permalink

your code is wrong this is how suposse to be…

if(choice1 === choice2) { return “The result is a tie!” } else if (choice1 === “rock”) { if (choice2 === “scissors”){ return”rock wins”; } else { return”paper wins”;
} }

points
Submitted by Braulio Santos
over 8 years