Understanding Typescript Generics and How to Implement Themby@amarachi
6,600 reads

Understanding Typescript Generics and How to Implement Them

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Typescript Generics are a way to define flexible variables, functions, objects, arrays etc. They are a stricter, more syntactical superset of [JavaScript] The language has become quite popular for a number of reasons, some of which are: easier to read and understand. Sometimes we need a particular function or object to work with a wide range of types and not be restricted by the rigidity that comes with writing with typescript. We trade-off the type definition for flexibility by using the `any` keyword like the code block below.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Understanding Typescript Generics and How to Implement Them
Amarachi Iheanacho HackerNoon profile picture

@amarachi

Amarachi Iheanacho

Frontend Developer and Technical Writer


Receive Stories from @amarachi

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!