Skip to content

Glossary: TypeScript Beyond the Basics

Type predicate

Also written: x is T, type predicates

A return type of the form `value is Type`. When the function returns `true`, TypeScript narrows the argument to that type.

Where the book teaches it

Related terms

User-defined type guard