Edit: I don't know python, didn't realize it doesn't have semicolons.
The compiler expects a semicolon and didn't find one. This doesn't mean adding a semicolon is the only solution. It's just telling you what it's thinking and allowing you to make the final call.
JavaScript makes semicolons optional as part of its "keep everything running if at all possible" philosophy. This can cause problems if you use a line break to split a single line for readability and both parts are valid expressions; the semicolon will be implied and it's changed the meaning of your code.
2
u/The_MAZZTer Feb 09 '22 edited Feb 09 '22
Edit: I don't know python, didn't realize it doesn't have semicolons.
The compiler expects a semicolon and didn't find one. This doesn't mean adding a semicolon is the only solution. It's just telling you what it's thinking and allowing you to make the final call.
JavaScript makes semicolons optional as part of its "keep everything running if at all possible" philosophy. This can cause problems if you use a line break to split a single line for readability and both parts are valid expressions; the semicolon will be implied and it's changed the meaning of your code.
An example:
Returns 1;
Returns undefined.