3 ms·
How about formatting the ternary thusly: value = test ? (some_value * multiple) : false_value;
by dmckeon 14y ago
How about formatting the ternary thusly:
value = test
? (some_value * multiple)
: false_value;
- Symmetry 14y agoTo match, it would have to be: value = test ? some_value * multiple : test2 ? second_value : false_value; Which, you know, isn't that bad. But it looks really weird since people don't expect you to use ternary that way, while multi-part if statements are fairly normal.