You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right, that comments should only have mentioned while loops, which have the same introductory structure as if conditions in that the condition and the body can be grammatically adjacent.
Braces aren't required around for loop bodies.
And they happen to be required around do loop bodies, but in that case it's not for the reason that a conditional could be ambiguous/confusion, since the body isn't adjacent to a conditional expression. There it's just for readability taste reasons.
In a single statement function
and in a for-loop with only one statement
curly braces are optional.
But for if
and while
curly braces are mandatory. This seems inconsistent to me. Or do I miss something?
The text was updated successfully, but these errors were encountered: