Unexpected token else




Could you please copy and paste your code instead?

From what I can see, you probably just added an extra closing curly brace.


@javaplayer09996 based on your answer:

In line 29, delete the }
(reason: you accidentally closed the the function with the additional } too early, that extra } end/stop the function at line 29, but you still have some code that you need to run for line 30 onwards, thus leading to your error.)

In line 36, add the }
(reason: you need to close the else if condition (choice 1 === "scissors") after running all the codes, the } in line 37 is closing the whole function, so you need another } in line 36 to close the else if statement before the function ends at line 37's }.)

then your code should be working.

If you still have question, please follow @rhyscrypto's suggestion, copy and paste your code here, we can't know what else might be wrong except for what you've print-screened. Thanks :slightly_smiling_face:

If you have time, do refer this question here:
the { } syntax is important, another user is facing roughly the same situation there.

Another exercise 12 functions if else problem

Thank you guys so much!!


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