2 ms·
I think it is better to not think of ; (or lack of ;) as an "active" return: it isn't like the `return` keyword. If the last statement/expression in a block is
by dbaupp 7y ago
I think it is better to not think of ; (or lack of ;) as an "active" return: it isn't like the `return` keyword.
If the last statement/expression in a block is an expression not followed by ;, the block evaluates to that expression. Otherwise (such as, the last expression has a ;), the block evaluates to ().
The function "return" behaviour is because function bodies are blocks: a function returns the value of its block (or any `return`).