Skip to content

Glossary: TypeScript Beyond the Basics

Generic

Also written: generics, generic function, generic class, generic interface

Code that has type parameters, so one function, interface or class works for any type and keeps it. Priya's `first` function can return a `Product` or a `string` depending on the list.

Where the book teaches it

Related terms

Type parameterConstraint