StudyPlayground / TypeScript-Exercise-Challenges

Typescript exercise & challenges
2 stars 0 forks source link

Type Challenges 2595-PickByType #63

Open kscory opened 4 months ago

kscory commented 4 months ago

답안을 작성해주세요.

wogha95 commented 3 months ago
type PickByType<T, U> = {
  [key in keyof T as T[key] extends U ? key : never]: T[key];
}
kscory commented 3 months ago
type PickByType<T, U> = {
    [K in keyof T as T[K] extends U ? K : never]: T[K]
}
bananana0118 commented 3 months ago
type PickByType<T, U> = {[key in keyof T as T[key] extends U? key : never]:T[key]}