The Ternary operator replaces an `if`/`else` block in a condensed format. It is also referred to as the conditional operator, inline if (iif), or ternary if. The following is the general format of the ternary operator.
You can also chain a ternary operator indefinitely, in a similar way to using `else if's` before the final `else` of an an `if`/`else` block. Each time the colon is used to state the `else` part of the ternary operator a new condition can be stated until the final termination condition is used.
This way of using the ternary operator needs to be done sparingly and in the right places, which is why (as is the case with using multiple `else if's`), it can sometimes lead to more readable code by using a `switch` statement instead.
It is advisable to use the ternary operator only in cases which include both `if` and `else` conditions, otherwise using an `if` block is recommended. Chaining ternary operators without care may cause unforeseen bugs.