So pragmatically, I\'ve got a quick and dirty answer to what I\'m looking for here. But why isn\'t using that a good idea? Why can\'t I find any formal documentation of it
It is standard, part of the spec (if-statement, other statements) and supported everywhere. Minification does not break it, because whitespaces have no semantics in JS - it even will enforce it for one-line-statements to save the two braces.
So, it is widely used (without problems!) as well. Sometimes it is considered bad because appending statements to the indented body without adding the braces can lead to problems. Also, it can lead to erratic behaviour when used in nested ifs:
if (false)
if (whatever)
;
else
alert("");
Would you have expected an alert? No, the else
belongs to the last if
.
Yet, you can use it unconcerned for one-line-statements that are sure not to get extended, like return;
.