Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Challenges 2595-PickByType #63

Open
kscory opened this issue Mar 15, 2024 · 3 comments
Open

Type Challenges 2595-PickByType #63

kscory opened this issue Mar 15, 2024 · 3 comments
Labels
Challenges Problems of Typescript-Challenges

Comments

@kscory
Copy link
Member

kscory commented Mar 15, 2024

답안을 작성해주세요.

@kscory kscory added the Challenges Problems of Typescript-Challenges label Mar 15, 2024
@wogha95
Copy link
Member

wogha95 commented Apr 8, 2024

type PickByType<T, U> = {
  [key in keyof T as T[key] extends U ? key : never]: T[key];
}

@kscory
Copy link
Member Author

kscory commented Apr 9, 2024

type PickByType<T, U> = {
    [K in keyof T as T[K] extends U ? K : never]: T[K]
}

@bananana0118
Copy link
Collaborator

type PickByType<T, U> = {[key in keyof T as T[key] extends U? key : never]:T[key]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Challenges Problems of Typescript-Challenges
Projects
None yet
Development

No branches or pull requests

3 participants