Skip to content
Advertisement

Why is the “else” line giving an invalid syntax error?

I’m having this error:

JavaScript

The line which causes the problem is marked with a comment in the code:

JavaScript

w.rules is variable which is assigned to “World” class.

To be honest I have no idea why I get this. Before everything was fine and now that error shows up after adding some extra instructions in other indented blocks.

Any ideas?

Advertisement

Answer

Because you left out a closing brace

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement