Grokking TypeScript
0% completed
Built-in Generic Types
You have been using a generic type since the early chapters of this course, perhaps without noticing it: number[] is another way to write Array<number>. The standard type definitions that come with TypeScript declare Array<T> and many other generic types, and you can use them in any file with no import. Most of the others take an existing type and produce a new one from it, so you do not have to write the new shape by hand.
Most of the examples in this lesson start from one type:
interface User { id: number; name: string; email: string; }
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%