ğ TypeScript Fundamentals series : interfaces, type aliases, unions, tuples Part 2: Writing Safer Code: inference, strict mode, unknown, narrowing Part 3: Reusable Types: generics, utility types, enums vs literal unions (you are here) Each part stands on its own. Read them in order, or jump straight to the one you need. As your codebase grows you'll find yourself writing the same type over and over with small variations: a list of users, a list of orders, a "user but with every field optional".
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Grant
Contact Grant, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack