3 ms·
I don't know of a single instance where it's advised to omit a semicolon, nor one where a semicolon is strictly required. They are always optional. About all I'
by sli 10y ago
I don't know of a single instance where it's advised to omit a semicolon, nor one where a semicolon is strictly required. They are always optional. About all I've seen is Standard's guideline to put a semicolon before your entry point closure:
;(function() {
// .. snip
})()
And even that isn't required, it's just a function of another guideline: "Never start a line with (, [, or `." But still, that is only relevant to Standard, not to Javascript in general. It's completely self-enforced by deciding to use Standard if you want. I can't remember ever needing to put one of those characters at the start of a line outside that particular instance, anyway.
- maw 10y agoI think the reason was to work around too simplistic minifiers and concatenators.