DEV Community

Discussion on: JavaScript Ternary Operator

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

Yes, but your sentence refers to it as a conditional operator. It's called the "conditional operator" and it is a ternary operator because it takes 3 operands (similarly, binary operators take 2 operands, unary operators take one).

It is commonly referred to as the ternary operator because JS only has the one operator like this that takes 3 operands.

Thread Thread
 
lorenzojkrl profile image
Lorenzo Zarantonello

Updated! Thanks for the feedback!