3 ms·
So 'if', 'for', 'while' are not statements?
by FeepingCreature 4y ago
So 'if', 'for', 'while' are not statements?
- teddyh 4y agoNo. Those are syntactic elements.
- lmm 4y agoNot on their own. A full if, for or while (with the conditions and body) is usally a statement, and might be an expression in some languages.
- FeepingCreature 4y agoThe body is also not terminated by a semicolon. `while (true) { puts("Hello World\n"); };`
- lmm 4y agoWhat you've written there does compile though, which was the original condition :).
- FeepingCreature 4y agoI get the joke, but it's two statements, not one. (while and ;)
- shikoba 4y agoIn JavaScript no. But in some languages it can be.