Swift: using the ternary conditional operator?
Example:
let x = 10
The ternary conditional operator is a shorthand for a simple if-else statement.
Solution:
let result = x > 5 ? "Greater" : "Smaller or Equal"
Example: Solution:Swift: using the ternary conditional operator?
The ternary conditional operator is a shorthand for a simple if-else statement.
let x = 10
let result = x > 5 ? "Greater" : "Smaller or Equal"