The conditional operator evaluates an expression, returning one value if that expression evaluates to true, and a different one if the expression evaluates as false. Its syntax is:
If condition is true, the entire expression evaluates to result1, and otherwise to result2.