Skip to content

Glossary: Swift Basics

nil-coalescing

Also written: ??

The `??` operator, which gives the value inside an optional or a default on its right when it is `nil`, as in `nickname ?? "guest"`.

Where the book teaches it

Related terms

optionalnilif let