Partial<T> and when would you use it?Partial<T> is a TypeScript utility type that constructs a type with all properties of T set to optional. It's useful when you want to create an object that might only have a subset of properties from an existing type, for example, when updating an entity.interface User {
id: number;
name: string;
email: string;
}
type PartialUser = Partial<User>;
// Equivalent to: { id?: number; name?: string; email?: string; }
const updateUser = (id: number, changes: PartialUser) => { /* ... */ };