Conditional types let you assign different values based on a condition. The most common example? The ternary operator (?:
)
Example:
Enter an age and see if the person is an Adult or Minor:
1. What is the correct syntax for the ternary operator?
2. Which statement about ternary operator is true?
3. What will this code output if age = 16?
4. What is the purpose of conditional types?