Skip to content

Glossary: TypeScript Basics

typeof

Also written: typeof check

A JavaScript operator giving a value's type name as text, such as `"number"`. TypeScript narrows unions by it. In a type, `typeof STATES` means the type of the value `STATES`.

Where the book teaches it

Related terms

narrowingtype guard