Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The noteworthy bit is that declarations are valid in the conditional "expression" of if-statements and evaluate to the declared variable. It's imo not obvious that declarations are expressions sometimes.


To be precise, declarations are never expressions - there are two forms of if and while statements in the grammar, one taking an expression and the other a declaration.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: