Q27: How do `Exclude<T, U>`, `Extract<T, U>`, and `NonNullable<T>` work?
These utility types operate over union types:
Exclude<Union, ExcludedMembers>: Removes matching members from a union.Extract<Union, ExtractedMembers>: Keeps only matching members from a union.NonNullable<T>: Excludesnullandundefinedfrom a union type.
Key Takeaways
- Operate over union types via distributive conditional logic.