Generics in TypeScript
Because we don’t know what type the user will use!
Generics are a big part of programming. They allow us to write type-safe functions without even knowing what the actual type will look like. But we can set certain restraints on the types a programmer might use.
In this article, I will explain generics in TypeScript and how to use them. The only prerequisite of this article is a little bit of…