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 풀이 #3

Open
sbyeol3 opened this issue Aug 13, 2022 · 1 comment
Open

[2주차] Easy 풀이 #3

sbyeol3 opened this issue Aug 13, 2022 · 1 comment
Assignees

Comments

@sbyeol3
Copy link
Collaborator

sbyeol3 commented Aug 13, 2022

title solved
4-pick
7-read only
11-tuple 🏷
14-first of array 🏷
18-length of tuple 🏷
43-exclude
189-awaited 🏷
268-if
533-concat
898-includes 💡- myEqual
3057-push
3060-unshift
3312-parameters 🏷

풀이 link

✅: 해결
🏷: 해답 열람 후 다시 풀었음
💡: 다시 볼 필요 있음

@humonnom
Copy link
Collaborator

💡type-level equality check

1. 쌍방향 extends 체크

type Equal<T, U> = T extends U ? (U extends T ? true : false) : false;
  • readonly 키워드가 쓰인 경우 !Equal
Expect<Equal<Includes<[{ a: 'A' }], { readonly a: 'A' }>, false>>,
Expect<Equal<Includes<[{ readonly a: 'A' }], { a: 'A' }>, false>>,

2.

type-level equality operator

export type Equals<X, Y> =
    (<T>() => T extends X ? 1 : 2) extends
    (<T>() => T extends Y ? 1 : 2) ? true : false;

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