JavaScript Ternary Operator

The conditional operator is a shorthand for writing conditional if...else statements.

It is called a ternary operator because it takes three operands.

(condition) ? expression1 : expression2