3 ms·
This will only cause an error if both of these are true: - if the expression is the top level expression in a statement (like in my example code) or the left h
by Doxin 4y ago
This will only cause an error if both of these are true:
- if the expression is the top level expression in a statement (like in my example code) or the left hand side in a comma expression
- if the expression is not an assignment, increment, or decrement
So using it in a return is fine because then the expression is no longer the top level in the statement, the return is. Of course then the function calling THAT function must deal with not discarding the value. It's pretty neat.