Question
Implement the built-in Pick<T, K> generic without using it.
Constructs a type by picking the set of properties K from T
For example
interface Todo {title: stringdescription: stringcompleted: boolean}type TodoPreview = MyPick<Todo, 'title' | 'completed'>const todo: TodoPreview = {title: 'Clean room',completed: false,}
Answer
type MyPick<T, K extends keyof T> = {[P in K]: T[P]}
