WeCodeAcademy

Utility Types

TypeScript ships helpers that build new types from existing ones: Partial (all optional), Required, Readonly, Pick, Omit and Record.

Exampletypescript
Open in editor »

Readonly stops changes after creation.

Exampletypescript
Open in editor »
Quick check

Which utility type makes every property optional?

Your turn: write the code

Declare patch as a Partial<User> that only contains name: "Ada", and print it.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.