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
why isn't using that a good idea?
It is far to easy to add another statement and expect it to only fire if the if
passes
Why can't I find any formal documentation of it?
The MDN documentation:
Statement that is executed if condition evaluates to true. Can be any statement, including further nested if statements. To execute multiple statements, use a block statement ({ ... }) to group those statements.
ECMA-262 (page 89):
if ( Expression ) Statement
It seems that there's an indentation based one
No. Just an if, then a condition, then a statement. The statement can be formatted on the same line or the next line.
White space is not significant in JS.