Skip to content

Glossary: TypeScript Beyond the Basics

Discriminated union

Also written: discriminant

A union of object types that share a property, such as `ok: true` or `ok: false`, which tells you which member you have. Checking that property narrows the type.

Where the book teaches it

Related terms

Result typeNarrowing