Narrow types at runtime — typeof, instanceof, in, and custom type predicates for safe type narrowing.
Five passes over the same idea, each from a different angle. Do them in order, or jump to whichever you need.
Type guards narrow a type within a conditional block. Built-in guards: typeof (primitives), instanceof (classes), in (property check). Custom type predicates (param is Type) enable user-defined narrowing. Discriminated unions use a common literal property for exhaustive pattern matching.