타입스크립트에서 상수를 선언하는 방법에 대해 설명해주세요 #2
klmhyeonwoo
started this conversation in
General
Replies: 2 comments 1 reply
-
|
enum도 물론 있지만, as const를 최근에 많이 사용하는 편이다. (쓰다보니 enum이랑 as const 중 as const를 주로 사용하다보니 둘의 차이가 명확하게 떠오르지 않아 한번 더 코멘트 남겨야할 듯) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
답변: 타입 단언은 값, 객체, 배열 뒤에 as const를 붙이는 방식으로 구현이 되고, as const가 붙은 값은 readonly 속성이 됩니다. 피드백: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
타입스크립트에서 상수를 선언하는 방법에 대해 설명해주세요
@prgmr99, @klmhyeonwoo
Beta Was this translation helpful? Give feedback.
All reactions