Case File: One Function, Many Types
Four small helpers (group by, first or fallback, count by, map values) are written with no types, and the only quick fix is any. Use generics so the result type follows the input type: a group of parcels is a group of parcels, a fallback must match the items, and a wrong key function is an error. Real TypeScript in strict mode, generated for you alone.
Case File: One Function, Many Types
Four small helpers (group by, first or fallback, count by, map values) are written with no types, and the only quick fix is any. Use generics so the result type follows the input type: a group of parcels is a group of parcels, a fallback must match the items, and a wrong key function is an error. Real TypeScript in strict mode, generated for you alone.
In this lesson:
- typescript
- generics
- type-parameters
- inference
- utility-functions
- case-file
This lesson is part of a paid plan
Upgrade to Pro to unlock this course, its labs and its exam.
View Pricing Plans