Concept: When to Use Generics
Question
When should you use generics instead of `any` or union types?
Hint
Generics preserve type information — what goes in determines what comes out.
Explanation
Use generics when there is a relationship between input and output types that should be preserved. For example, identity<T>(x: T): T guarantees the output type matches the input. Using any would lose this relationship. Use union types when you have a fixed set of possible types. Use any only as a last resort.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.