Lesson 2.113mIntermediate18.7k students
Generic functions and inference
A type parameter links an input type to an output type. Most of the skill is letting inference do the work rather than annotating call sites.
This lesson sits in Generics, part of TypeScript for Application Developers. It assumes what came before it and leads directly into the next lesson in the module.
In this lesson you will
- Relate argument and return types with a type parameter
- Let inference fill in type arguments at the call site
- Recognise when a generic adds nothing over a union
Resources
Your notes for this lesson will appear here.