...

/

Creating generic type aliases

Creating generic type aliases

We can use generics in type aliases as well as interfaces. In this lesson, we will learn how to do this.

Generic type alias syntax #

We can pass types into a type alias using the following syntax:

type TypeName<T1, T2, ...> = {
 ...
}

The members of the type can reference the generic types passed into it.

Access this course and 1400+ top-rated courses and projects.