What is the most condense way to invert a boolean if another boolean is true. In other words, what is the shortest way of writing condition ? !value : value
, preferably evaluating value
only once?
Edit: Just so you know, I am passing the result to a method
The shortest way is
value ^= condition;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With