Forums
Learn
Careers
Store
About
SUBSCRIBE
WWDC23 SALE: Save 50% on all my Swift books and bundles! >>
Question 1/12: This code demonstrates using nil coalescing with optionals – true or false?
Hint: The data type on the left of ?? must be the same as the data type on the right. Click to show.
??
let painter: String = "Leonardo da Vinci" var artist: String = painter ?? "Unknown"
Correct! This uses nil coalescing without an optional.
Oops – that's not correct. This uses nil coalescing without an optional.
Return to Review Menu
You are not logged in
Link copied to your pasteboard.