Using some standard generic types
In this lesson, we start by understanding the syntax for generic types before consuming some of the standard generic types in TypeScript.
Understanding the generic type syntax #
Generic type allows us to create a specific type by allowing us to pass types into it as parameters. The parameters are passed inside angle brackets. If there are multiple parameters, they are separated by a comma.
const myVar = GenericType<SpecificType1, SpecificType2, ...>
This will make more sense as we use some of the standard generic types below.
Access this course and 1400+ top-rated courses and projects.