paint-brush
Understanding Typescript Generics and How to Implement Themby@amarachi
7,780 reads
7,780 reads

Understanding Typescript Generics and How to Implement Them

by Amarachi Iheanacho7mFebruary 1st, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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 Iheanacho

Amarachi Iheanacho

@amarachi

Frontend Developer and Technical Writer

About @amarachi
LEARN MORE ABOUT @AMARACHI'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Amarachi Iheanacho HackerNoon profile picture
Amarachi Iheanacho@amarachi
Frontend Developer and Technical Writer

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite