7. What if choice1 is paper?


#1

SyntaxError: Unepected token else???

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

#2

else is an optional part of an if-statement.
Presumably you've written "else" somewhere else (because it's only expected after if, so unexpected would be any other place)


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.