type MyPick<T, K extendskeyof T> = { [P in K]: T[P] }
The common wrong answer
type MyPick<T, K extendskeyof T> = { [P inkeyof T]: T[P] }
Mapping over `keyof T` copies the whole object — `K` is never consulted. The clause after `in` is the key set you are building, not the one you are reading from.
Line by line
{ [P in K]: ... }
`K` is a union of literal keys. A mapped type distributes over that union, producing one property per member.
T[P]
An indexed access. Because `K extends keyof T`, `P` is always a real key of `T`, so this never widens to `unknown`.
Takeaway
A mapped type reads `{ [Name in KeySet]: ValueType }`. Everything else in this track is a variation on that shape.