Skip to main content
TypeScript Code Completion Medium +20 XP

Pick Utility Type

Complete to pick only name and email from User.

TypeScriptFill in the blank
type Preview = ___<User, "name" | "email">;

Type the missing code

Show answer and explanation

Answer: Pick

Pick<T, K> constructs a type by picking the specified properties from T. Useful for creating view-specific types.

Hint: Which utility type selects specific fields?

What this challenge tests

Code Completion in TypeScript: utility-types, pick.

Related challenges