BeginnerLesson 16 of 1830 min · hands-on
Mapped and Conditional Types
Part of the TypeScript course
The utility types you just used (Partial, Pick, Record, ReturnType) are all built from two language features: mapped types for transforming the keys and values of an object, and conditional types for choosing between alternatives based on a type. Once you can read both, the standard library stops being magic.
keyof T is the union of T's property names as string literals ...
Want to learn TypeScript Mapped and Conditional Types in a real environment?
Click below, get a fresh Linux box with TypeScript ready to go, and work through Mapped and Conditional Types hands-on with an AI tutor that knows your code.
Start this lessonMapped and Conditional TypesWhat you'll learn
- Keyof operator
- Mapped types syntax
- Key remapping with as
- Conditional types
- Infer keyword
- Distributive conditional types
Read this lesson in your language
All lessons in this course
18 lessons- 1Hello, TypeScript20 min
- 2Type Basics25 min
- 3Arrays and Tuples25 min
- 4Object Types and Interfaces25 min
- 5Functions25 min
- 6Union and Literal Types25 min
- 7Type Narrowing30 min
- 8Type Aliases vs Interfaces20 min
- 9Optional, Readonly, and Nullable25 min
- 10Enums20 min
- 11Generics30 min
- 12Classes25 min
- 13Inheritance and Abstract Classes25 min
- 14Modules25 min
- 15Utility Types30 min
- 16Mapped and Conditional Types30 min
- 17Declaration Files and Libraries25 min
- 18tsconfig and the Compiler30 min
Explore other courses
Claude from Zero to Mastery
47 lessons · 8.4h
Vibe Coding: Fundamentals
12 lessons · 4.5h
Prompt Engineering
11 lessons · 6.2h
Python
19 lessons · 9.3h
Git
13 lessons · 5.9h
Docker
13 lessons · 6.6h
Kubernetes
14 lessons · 8h
Go
20 lessons · 12.3h
React
17 lessons · 10.2h
Linux
17 lessons · 8.5h
Ansible
12 lessons · 6.1h
Bash
12 lessons · 5.7h
Helm
10 lessons · 5.4h
GitLab CI
11 lessons · 5.8h
Jenkins
11 lessons · 5.3h
PostgreSQL
14 lessons · 7.6h
MySQL
13 lessons · 6.8h
Web
14 lessons · 5.9h
Vibe Coding
12 lessons · 5.8h
Vibe Coding: Prototype to Production
12 lessons · 5.5h
Vibe Coding: Multi-Agent Engineering
12 lessons · 5.3h
Vibe Coding: Advanced Engineering
12 lessons · 7.3h
