As I understand it, a conditional operator (the condition "consequence: alternative") is often referred to as a "tertiary operator" and "ternary operator".
What is the difference between these terms?
It should be called a "conditional statement". "Ternary operator" means that it takes three operands. Since this is the only general operator that does this, it is sometimes called the “triple” operator. The fact that there is only one thing is a coincidence. The tertiary operator is even more erroneous. This means something like "the third most important operator."
- 65 1,8 .
, , "" " " - , , , , , . , , "", "" "".
" " - . , , .
"". " ", , .
"" , "". , .
, .
" []", " ". - , .
, (1 ? 2 : 3;), .
1 ? 2 : 3;
. Ternary , ( ). Tertiary third .
Ternary
Tertiary
third
Wikipedia:
( ) , .
I have never heard it called a "tertiary operator." So the difference is that one of them will make you look like a newbie. I think so.
one is right and one is wrong
a ternary operator is an operator with three inputs, for example,? b: c, he's arity of 3
Will a tertiary operator mean only the third operator? it does not matter