␡
- Unary Operators
- Binary Operators
- Ternary Conditional Operators
- Summary
- Q&A
- Workshop
- Exercise
This chapter is from the book
Ternary Conditional Operators
Swift has only one ternary conditional operator, and it is written as short-hand for a longer expression that checks a particular case or condition and provides a value for the true branch and another value for the false branch. We cover the ternary conditional operator in greater detail in Hour 5, since it is a more succinct substitution for a longer conditional expression.