When I read current ECMAScript specs (1.5ish years ago) it clearly states semicolons are optional... That is because of automatic insertion when it is parsed out. People will point to very contrived situations where not having a semicolon causes an error, but they are few and far between. Also, there are lots of situations where using a semicolon doesn't do what you think it will and there is still a parsing error (also usually very contrived examples...). In the situations where it will throw an error just understand the rules and put in a semicolon, not hard once you understand. But the idea the "just using semicolons at the end of every statement" just magically makes everything "safer" is more rooted from years ago when some parsers didn't honor the language specs properly, but they do now. There is a reason semicolon free JS is becoming more and more prevalent.
Because it is fine and within the specs of the language.
But if code sacrificed to semicolons causes your brother to stumble, do the loving thing and throw in some semicolons...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
#ShamelessPlug
Inflammatory Topics & Being A Reasonable Dev...
Chad Windham
When I read current ECMAScript specs (1.5ish years ago) it clearly states semicolons are optional... That is because of automatic insertion when it is parsed out. People will point to very contrived situations where not having a semicolon causes an error, but they are few and far between. Also, there are lots of situations where using a semicolon doesn't do what you think it will and there is still a parsing error (also usually very contrived examples...). In the situations where it will throw an error just understand the rules and put in a semicolon, not hard once you understand. But the idea the "just using semicolons at the end of every statement" just magically makes everything "safer" is more rooted from years ago when some parsers didn't honor the language specs properly, but they do now. There is a reason semicolon free JS is becoming more and more prevalent.
Because it is fine and within the specs of the language.
But if code sacrificed to semicolons causes your brother to stumble, do the loving thing and throw in some semicolons...