News for hackers. Stuff that matters.
Re:“It is never a compiler error” by inimino on Thursday November 16, 2017 @02:04AM (#15710732)
No, JS will never never insert a semicolon after “if(foo)” no matter what comes after it. Putting the braces on your control structures on the same or the next lines has no interaction whatsoever with the semicolon insertion rules.

I’ve written a ridiculously detailed blog post about automatic semicolon insertion if you want to know all the specifics.

http://inimino.org/~inimino/blog/javascript_semicolons

There are no comments on this comment yet.