The conditional operator is important when you want your programs to utilize
correct grammar. Most prominently, when differentiatiating between
plural and
singular forms. So rather than "There
are 1
values greater than 10," or "There
is 5
value less than 20," you can use conditional operators to keep you from sounding like an idiot:
(value == 1 ? "is" : "are")
(value == 1 ? "value" : "values")
So when "value" (whatever it is) is equivalent to one (one apple, one truck, one
SCV), the singular form will be chosen; when it is more (or less) than one (3 accident
s, 25 bill
s, 0 dollar
s), the plural form will print.
Correctly, now: There
is one
value; there
are 5
values.