본문 바로가기

TypeScript6

[Type Challenge] Capitalize 문제 https://github.com/type-challenges/type-challenges/blob/main/questions/00527-medium-append-to-object/README.md GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge Collection of TypeScript type challenges with online judge - GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge github.com 문제 의도 및 개념.. 2023. 4. 9.
[Type Challenge] Append to Object 문제 https://github.com/type-challenges/type-challenges/blob/main/questions/00527-medium-append-to-object/README.md GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge Collection of TypeScript type challenges with online judge - GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge github.com 문제 의도 및 개념.. 2023. 4. 8.
[Type Challenge] BEM style string 문제 https://github.com/type-challenges/type-challenges/blob/main/questions/03326-medium-bem-style-string/README.md GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge Collection of TypeScript type challenges with online judge - GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge github.com 문제 의도 및 개념.. 2023. 4. 7.
[Type Challenge] Absolute 문제 https://github.com/type-challenges/type-challenges/blob/main/questions/00529-medium-absolute/README.md GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge Collection of TypeScript type challenges with online judge - GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge github.com 문제 의도 및 개념정리 infer.. 2023. 4. 3.
[Type Challenge] Length of Tuple 문제 https://github.com/type-challenges/type-challenges/blob/main/questions/00018-easy-tuple-length/README.md GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge Collection of TypeScript type challenges with online judge - GitHub - type-challenges/type-challenges: Collection of TypeScript type challenges with online judge github.com 문제 의도 및 개념정리 as .. 2023. 4. 2.
[TS] Enum vs Object 회사의 소스코드를 보던 중에 문득 들었던 궁금증에 대해서 해결해보고자 합니다. Enum과 Object의 차이를 알아보고, 어떤것을 사용하는것이 좋은지 결론을 내보겠습니다. 네이버 블로그식 질질끌기 포스팅을 제일 싫어해서.. 빠르게 써보겠습니다. ​ 결론부터 내면 object가 as const로 type assertion을 해서 충분히 사용 가능하면 enum은 필요없다 입니다. Enum TS에서 자체적으로 구현한 열거형으로 C의 enum과 유사합니다. '자체적' 이라는 말에서 알 수 있듯, js에는 존재하지 않습니다. ​ Enum은 어떻게 트랜스파일 될까? IIFE(즉시실행함수표현) 의 형태로 변환됩니다. js의 object는 멀쩡하게 나오는것을 볼 수 있습니다. ​ Enum이 Object보다 나은 장점 .. 2022. 9. 11.
728x90