Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. TypeScript Mastery

Lesson 13 of 56 · Typescript

Utility Types – `Partial`, `Pick`, `Omit`, `Readonly`

Duration: 15 minutes

The Standard Library Utility Types

Partial<T> – make all properties optional

type User = { id: number; name: string; };
type UserUpdate = Partial<User>;

Pick<T, K> – select a subset of keys

type UserName = Pick<User, "name">; // { name: string }

Omit<T, K> – remove keys from a type

type UserNoId = Omit<User, "id">; // { name: string }

Readonly<T> – all properties become read‑only

type ReadonlyUser = Readonly<User>;
// readonly id: number; readonly name: string;

NonNullable<T> – exclude null and undefined

type MaybeString = string | null | undefined;
type DefinitelyString = NonNullable<MaybeString>; // string

Info

Utility types are building blocks for type composition. Combine them to express complex shapes without reinventing the wheel.

Previous: Conditional TypesNext: Type Guards & Discriminated Unions