7/9 what if choice1 is paper


#1

else if(choice1 === "paper"){

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

}
};

SyntaxError: Unexpected token else

i used the same method as previous exercise. is it not essentially the same exercise?


#2

Look closely.:smiley:


#3

it should be if then else if, then else. it's else if not if else .


#4

It's just that the level has a lot of parts to it, so it just has an if and else statement inside the else if statement. The problem is that:

The else is supposed to be taken out, for it's a syntax problem.:smiley:


#5

if(choice1 === "paper"){

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

}
};

SyntaxError: Unexpected token else

thanks for the help. ive tried the different suggestions. this is what ive come up with so far?!


#6

you have an extra bracket at the bottom


#7

If you show your complete code... I would suggest as @mr_trickster had said to take out a bracket there, and also take out the semi colon after your bracket, if you have an 'else if' statement after this. Would be more helpful if you show me the complete code. :smiley: