Generics In TypeScript
In this post I want to explore all the functionality available in TypeScript to use generics. Let’s start with the simples example of creating strongly types arrays. module generics { class Person { name: string; parents: Person[]; } } Now, you can only add a person to parents collection. It is very simple, but you cannot for example add a …