Glossary term
What is narrowing (Type narrowing)?
narrowing stands for Type narrowing.
In Senior Frontend Depth
TypeScript makes a value's type more exact inside a branch, after a check like typeof, in or a tag comparison.
Learn it properly · Senior Frontend DepthLesson 4: Advanced TypeScript for Interviews: Generics, Narrowing, Utility and Conditional TypesGeneric constraints, discriminated unions, infer, mapped types, satisfies, and keeping API response types correct from the server to the UI.In TypeScript From Zero
Checks like typeof or in that let TypeScript treat a value as a more specific type inside a block.
Learn it properly · TypeScript From ZeroLesson 1: Basic Types, Inference and NarrowingPrimitives, unions, literal types, any versus unknown versus never, inference, narrowing and discriminated unions.