CodeZettaInterview Hub

TypeScript · Type Narrowing · Junior · Concept

How does typeof narrowing work and its limits?

Short Interview Answer

Distinguishes primitives; typeof null is object historically — handle null separately.

Detailed Explanation

Doesn't narrow custom class instances well — use instanceof.

Did you know this answer?