What Are Generics?
Get an overview of generics and its naming conventions.
We'll cover the following
Overview
Generics in TypeScript offer a means for creating reusable code components that work with a variety of types (rather than just one). As we mentioned, they can be thought of as variables—but for our types. Generics provide a way to create flexible structures that allow us to define the type later.
Let’s start with a simple linked list. A linked list node contains a value and then a link to the next node. We could start with something like this:
Get hands-on with 1400+ tech skills courses.