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.
Link copied to your pasteboard.