Hello all,
I have a question question regarding the "default value" used in nil coalescing. My tutorial book states the following about the topic:
“You use it when you want to get a value out of the optional no matter what — and in the case of nil, you’ll use a default value. This is called nil coalescing. Here’s how it works:
var optionalInt: Int? = 10
var mustHaveResult = optionalInt ?? 0”
Would I be correct in assuming then that the default value used in nil coalescing - which according to the book is provided in cases of an optional having a value of nil - should always be 0?
Please help, thank you!