Utility Partial
Question
What does Partial<T> do?
Hint
Partial<T> is equivalent to a mapped type with ? added.
Explanation
Partial<T> makes all properties of type T optional. If T = { name: string; age: number }, then Partial<T> = { name?: string; age?: number }. Useful for update operations where you only provide some fields: function updateUser(id: number, data: Partial<User>) { ... }. Partial is a built-in utility type implemented as type Partial<T> = { [P in keyof T]?: T[P]; }. Related: Required<T> (removes ?), Pick<T, K> (select keys), Omit<T, K> (remove keys).
Related Resources
Related Lessons
- Utility Types
Learn utility types.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.