Skip to main content
eLearner.app
TS TYPE GYMNASTICS ARENA

TS Type Arena: Type Gymnastics

Overcome the constraints of the TypeScript compiler by resolving three advanced typing puzzles (mapped types, conditionals, and key remapping).

TYPE CONSTRAINT

Create a custom version of the utility type 'Pick<T, K>'. Your type 'MyPick<T, K>' must accept an object type T and a union of keys K, extracting only the requested properties from T using mapped types and key constraints (extends keyof T).

Constraint Monitor
CONSTRAINT UNMET
interface User {
name: string;
age: number;
active: boolean;
}
MyPick<User, "name" | "active">
✗ Type does not satisfy constraints or uses any/never
✗ Type does not satisfy constraints or uses any/nevertsc v5.4.5

Stuck?

Learn the fundamental concepts in the TypeScript course to solve this challenge.

Static TypeScript Compiler

Write valid type definitions to satisfy type assertions.

Loading editor…