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

[2주차] Easy 풀이 #4

Open
sbyeol3 opened this issue Aug 13, 2022 · 13 comments
Open

[2주차] Easy 풀이 #4

sbyeol3 opened this issue Aug 13, 2022 · 13 comments
Assignees

Comments

@sbyeol3
Copy link
Collaborator

sbyeol3 commented Aug 13, 2022

No description provided.

@Choozii
Copy link
Collaborator

Choozii commented Aug 19, 2022

4.Pick

type MyPick<T, K extends keyof T> = {
//첫번째 인자의 key값들만 접근할 수 있도록 함
[P in K] : T[P]
}

@Choozii
Copy link
Collaborator

Choozii commented Aug 19, 2022

7. ReadOnly

type MyReadonly = {
readonly [key in keyof T] : T[key]
}

@Choozii
Copy link
Collaborator

Choozii commented Aug 19, 2022

11. Tuple to Object

type TupleToObject<T extends readonly any[]> = {
[K in T[number]] : K
}

@Choozii
Copy link
Collaborator

Choozii commented Aug 19, 2022

14. First of Array

type First<T extends any[]> = T extends []? never : T[0]

@Choozii
Copy link
Collaborator

Choozii commented Aug 19, 2022

18. Length of Tuple

type Length<T extends readonly unknown[]> = T["length"]

@Choozii
Copy link
Collaborator

Choozii commented Aug 19, 2022

43. Exclude

@Choozii
Copy link
Collaborator

Choozii commented Aug 19, 2022

189. Awaited

@Choozii
Copy link
Collaborator

Choozii commented Aug 19, 2022

268. If

type If<C, T, F> = C extends true?T:F

@Choozii
Copy link
Collaborator

Choozii commented Aug 19, 2022

533. Concat

type Concat<T extends any [], U extends any []> = [...T, ...U]

@Choozii
Copy link
Collaborator

Choozii commented Aug 20, 2022

898. Includes

type Includes<T extends readonly any[], U> =
T extends [infer F, ...infer R]? Equal<F, U> extends true? true : Includes<R, U> : false;

@Choozii
Copy link
Collaborator

Choozii commented Aug 20, 2022

3057. Push

type Push<T extends any [], U> = [...T, U]

@Choozii
Copy link
Collaborator

Choozii commented Aug 20, 2022

3060. Unshift

type Unshift<T extends any [], U> = [U, ...T]

@Choozii
Copy link
Collaborator

Choozii commented Aug 20, 2022

3312. Parameters

type MyParameters<T extends (...args: any[]) => any> = T extends (...args: infer A) => any? A : never;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants