A practical introduction to TypeScript conditional types, showing how to define types that resolve differently based on type conditions. Two examples are covered: a TypeName utility that maps a generic type to its string representation, and a Halloween-themed example demonstrating how to filter union types using conditional types to extract subsets like candies, tricks, or candies without peanuts.
Sort: