cf.completefrontend

Write the codeMedium

Write MyPick<T, K>: keep only the keys K of T, and reject keys T doesn't have.

Write this
type MyPick<T, K> = T; // keep only the keys in K type Todo = { title: string; description: string; done: boolean }; // type Preview = MyPick<Todo, "title" | "done">;// { title: string; done: boolean }// MyPick<Todo, "titel"> should be an error

Solve it in the editor

The answer

Write it yourself first. Then compare it with a reference solution and the checks it passes.

Checking your sign-in…