Aliases with Generic Types and Recursivity

In this lesson, we will see how to use an alias with generic types and recursivity.

Generic types and aliases

A generic type can also leverage an alias. It is possible to assign a name to a generic structure as we can do with an interface. Using the less-than < and, greater-than > signs as with an interface, a generic type can be specified to a different type.

On lines 1 and 7, both interfaces have a generic type named TOption to define a type within the interface.

Get hands-on with 1400+ tech skills courses.