Hello

By: sahib

October 8, 2021

Share

Hello again

The nil-coalescing operator (a ?? b) unwraps an optional a if it contains a value, or returns a default value b if a is nil. The expression a is always of an optional type. The expression b must match the type that’s stored inside a.

The nil-coalescing operator is shorthand for the code below: