Skip to content

Glossary: TypeScript Basics

optional chaining (?.) and nullish coalescing (??)

Also written: ?., ??

`?.` gives `undefined` instead of crashing when the left side is `null` or `undefined`, and `??` supplies a default in that case. Both are used to handle missing values.

Where the book teaches it

Related terms

narrowingoptional (property or parameter)