Swift - Operators and Expressions
Given nested optionals
let data: Int?? = 5, which expression safely unwraps to get the Int value?let data: Int?? = 5, which expression safely unwraps to get the Int value?Int?? means optional of optional Int, so unwrapping requires two steps.data?.flatMap { $0 } unwraps outer optional and then inner optional safely.?? 0 returns 0.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions