Skip to Content
TypeScript Intermediate: Types That Survive Real Projects
Intermediate
0 likes
Courses
TypeScript Intermediate: Types That Survive Real Projects

Check Yourself: Generics Without the Fog

Five scenario questions on type parameters, constraints and generic types. If you miss more than one, reread the lessons in this section.

Course content

Sign in to save your progress.

Course Home
3. mapAll takes items as an array of T and a callback from T to U, and returns an array of U. You call mapAll with ["a", "bb", "ccc"] and a callback that returns s.length. What is the type of the result?
4. You declare type Page with a type parameter T, holding an array of T and a total, and then write const users: Page = { items: [], total: 0 }. What does the compiler say?

About

Five scenario questions on type parameters, constraints and generic types. If you miss more than one, reread the lessons in this section.

Duration
5 min
Last update
10/12/2026
Was this helpful?
​ 0 ​ 0

Comments (0)

Sign in to comment

No comments yet.