TypeScript · Generics and utility types

Partial<T>

Makes every property optional. Ideal for patch and update payloads.

Syntax
Partial<User>

Example

Example
type User = { id: string; name: string };
function update(id: string, patch: Partial<User>) {}
update("u1", { name: "Ada" });

More in this group

as const Awaited<T> Generic constraint Generic function Indexed access keyof Parameters<T> Pick<T, K> / Omit<T, K>

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course