In both a ? b : c and a && b || c, a is a boolean expression. What can ?: do that &&|| cannot?print 1 ? 'true' : 'false'; # True print 1 && 'true' || 'false'; # True print 0 ? 'true' : 'false'; # False print 0 && 'true' || 'false'; # False
In reply to Re: Re: Re: Trinary or If'n'Else?
by Anonymous Monk
in thread Trinary or If'n'Else?
by SamQi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |