Swipe to navigate through the chapters of this book
Generic types are placeholders for types that are resolved when a class or function is used, allowing type-safe code to be written that can deal with a range of different types, such as collection classes. This is a concept that is more easily demonstrated than explained, so I start this chapter with an example of the problem that generic types solve and then describe the basic ways that generic types are used. In Chapter 13, I describe the advanced generic type features that TypeScript provides. Table 12-1 summarizes the chapter.
Please log in to get access to this content
To get access to this content you need the following product:
- Using Generic Types
- Sequence number
- Chapter number
- Chapter 12