4 ms·
I've always read ternary statements to myself as a question. some_condition ? this : that some_condition? then this, otherwise that Typing this, I realize
by heywire 10y ago
I've always read ternary statements to myself as a question.
some_condition ? this : that
some_condition? then this, otherwise that
Typing this, I realize how hard it is to explain without speaking it :)
- lawpoop 10y agoIs the color red? If so, this; otherwise, that. It's a little tricky, because in the above, the `if` keyword appears after the question mark. Is the color red? Yes-- this: no-- that. Trying to make a parsimonious English sentence while maintaining the syntax elements : P
- kbutler 10y ago> some_condition ? this : that Just read it as: IF some_condition THEN this ELSE that