Skip to content

Glossary: TypeScript Basics

narrowing

Also written: narrow, narrowed

Turning a wider type, such as a union, into a narrower one with a check like `typeof id === "number"`. Inside the `if`, TypeScript knows the more specific type.

Where the book teaches it

Related terms

type guardunion typeunknowntypeof