train
to
code
YouTube
TypeScript Generics Quiz
Question 1
What is the main purpose of generics in TypeScript?
To make values mutable at runtime
To write reusable code that works with many types while staying type-safe
To replace interfaces entirely
To disable strict null checks