Ternary Operators

A ternary operator is a shorthand, one-line way of writing an if-else statement. Instead of writing multiple lines of code for a simple assignment, you can evaluate a condition inline.