Generic type arguments

up:: Typescript TypeScript: Documentation - Generics

  • The <> are called “angle brackets”.

Let’s say you specify that a prop on a function should be an array. That still doesn’t say what type of values are in this array. That is where generics come in.

type StringArray = Array<string>;
type NumberArray = Array<number>;
type ObjectWithNameArray = Array<{ name: string }>;

So, Array<string>, is equivalent to string[].