CodeZettaInterview Hub

TypeScript · Type Narrowing · Mid-Level · Concept

in operator narrowing?

Short Interview Answer

Checks property existence to narrow unions of objects.

Detailed Explanation

Careful with optional properties and prototypes. Prefer discriminants when possible.

Did you know this answer?