I am working on a project and need to know what the name of the statement if officially called. I have used it a lot, I just no clue what the name is.

Example statement:

let x = didJump ? 10 : 5

2 Answers

2
Community On

The question mark is called thé "ternairy operator". The statement is called a "ternairy statement".

1
Eric Postpischil On

It is called the ternary conditional operator in The Swift Programming Language (Swift 5.0).