728x90
반응형
const animals = ['cat', 'dog', 'mouse'] as const
// const animals: readonly ['cat', 'dog', 'mouse']
728x90
반응형
'🌳Frontend > typescript' 카테고리의 다른 글
타입도 분기처리 할 수 있나요? 타입스크립트에서 조건부 타입 알아보기 (0) | 2024.02.16 |
---|---|
Typescript 에서 string union type을 type guard 하는 법 (typeof Array[number] 와 as const) (0) | 2023.09.17 |
[타입스크립트/Typescript] clean code 클린코드 (0) | 2023.03.21 |
728x90
반응형
const animals = ['cat', 'dog', 'mouse'] as const
// const animals: readonly ['cat', 'dog', 'mouse']
728x90
반응형
'🌳Frontend > typescript' 카테고리의 다른 글
타입도 분기처리 할 수 있나요? 타입스크립트에서 조건부 타입 알아보기 (0) | 2024.02.16 |
---|---|
Typescript 에서 string union type을 type guard 하는 법 (typeof Array[number] 와 as const) (0) | 2023.09.17 |
[타입스크립트/Typescript] clean code 클린코드 (0) | 2023.03.21 |