Question · JavaScript and TypeScript course · Module 6: TypeScript Basics
Generic Type vs Type Alias
What is the key difference between a generic type and a type alias in TypeScript?
Answer options
- A type alias can only be used with interfaces
- A generic type allows parameterization by type, so the same code works with different data types
- A type alias is faster to compile than a generic type
- A generic type only works with functions, not classes
You can check the correct answer by solving this task in the CodeWorlds game.