DEV Community

Discussion on: Ternary Unwrapping in Swift

Collapse
 
tonyayoub profile image
Tony Ayoub

What about this:
let optionalNumber: Int? = 33
let sentence = optionalNumber.flatMap { "My favourite number is ($0)" }