Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
While The Conditional Operator's name is not The Ternary Operator, it is however correct to reference it by it's type as The Ternary Operator. The difference being one you are calling by name and one by type.
Tldr:
The conditional operator (
?:
) is a ternary operator, and the addition operator (+
) is a binary operator.As the conditional operator is the only ternary operator, people usually refer to it as
the ternary operator
, but that isn't completely true.Correct (mostly).
While The Conditional Operator's name is not The Ternary Operator, it is however correct to reference it by it's type as The Ternary Operator. The difference being one you are calling by name and one by type.
So in the end it doesn't matter what you'd call it until someone comes up with another ternary operator.
Maybe you should call it the ternary conditional operator :D