|
|
|
|
|
by ricardobeat
5185 days ago
|
|
So in this case: var value = x + fn
(y).burp()
Is it obvious that there is a missing semi-colon at the end of line 1? The code is technically correct without it (not that I approve of it). You can assume it's wrong, but it's just a guess.If your code is in no-semi-colon style, there is no ambiguity, you can be 100% sure that this is a mistake: there always should be a semi-colon guarding that parenthesis, regardless of intent: var value = x + fn
;(y).burp()
It's about removing ambiguity and visual clutter with a simple set of rules.How many JS programmers know the difference between a function expression or declaration, and the semi-colon that should follow or not? You're dependent on a linter. Following the no-semi-colon rules makes your intentions clear in every case, without machine validation. |
|