Nitpick: It's a ternary operator known as the conditional operator. For instance in javascript:
The conditional (ternary) operator is the only JavaScript operator that takes three operands. This operator is frequently used as a shortcut for the if statement.
I use it quite often. I'm a fan of the formatting style that Nimmo proposes, using a newline for the ? part and another newline for the : such that I don't have to scroll sideways.
Nitpick: It's a ternary operator known as the conditional operator. For instance in javascript:
(ref: MDN Web docs : Conditional (ternary) Operator
I use it quite often. I'm a fan of the formatting style that Nimmo proposes, using a newline for the
?
part and another newline for the:
such that I don't have to scroll sideways.Yeah. Thanks for pointing that out.