3 ms·
"? true :" is equivalent to just "||".
by mormegil 7y ago
"? true :" is equivalent to just "||".
- thomasahle 7y agoAnd "X && Y || Z" is usually equivalent to "X ? Y : Z". So "nullableVariable != null ? nullableVariable.someMethodCall() : fallbackIfNullMethodCall();".
- twiceaday 7y agoIf X is true and Y is false this returns Y instead of Z which is wrong.