Quiz · 3 questions
🧰 Utility Types — The Built-in Standard Library of Types
Partial, Required, Pick, Omit, Record, ReturnType, Parameters, Awaited, NonNullable
Level 0Curious
0 XP0/93 lessons0/23 achievements
0/100 XP to next level100 XP to go0% complete
Quiz
01What does
Partial<User> produce?Hint
Partial is implemented as
type Partial<T> = { [K in keyof T]?: T[K] } — a mapped type with ?.02What's the difference between
Pick<T, K> and Omit<T, K>?Hint
Pick<User, keyof User> equals User. Omit<User, never> equals User. The extremes give you back the original.03What does
Awaited<Promise<Promise<string>>> give you?Hint
Try
await Promise.resolve(Promise.resolve('hi')) at runtime — JavaScript also unwraps both levels.Comments 0
🔔 Reply notifications (sign in)Sign in — Please sign in to comment.
No comments yet — be the first.