This is called Ternary Operator, you can refer to the documentation.
The expression (expr1) ? (expr2) : (expr3) evaluates to expr2 if expr1 evaluates to true, and expr3 if expr1 evaluates to false.
2.1m questions
2.1m answers
60 comments
57.0k users