Hacker News new | ask | show | jobs
by inimino 3138 days ago
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