Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 배열중복요소제거
- reactnative
- materialicons
- 슬라이딩윈도우
- react
- err_connection_refused
- extends
- 타입스크립트
- app.post
- 이진탐색
- Filter
- 스크롤이벤트
- reactnative error
- npm에러
- map
- forwardref type
- array
- javascript
- 상속
- interface
- Next.js
- async
- Spring
- mainapplication.kt
- 안드로이드빌드에러
- generic
- TS
- set
- app:compiledebugkotlin
- 리액트네이티브아이콘
Archives
- Today
- Total
목록readonly (1)
rhanziy
TS - type alias와 readonly
type 키워드를 써서 가독성과 확장성을 높일 수 있다. 간단쓰 type Animal = string | number | undefined; let animal :Animal = 'cat'; // obj일 때 type Animal = { name :string, age :number } let 동물 :Animal = { name : 'munzi', age : 10 } const 변수는 등호할당만 막아지는데, 오브젝트 자료형일 경우 아래와 같이 실수로 수정을 할 수 있음. const 출생지역 = { region : 'seoul' } 출생지역.region = 'busan' 타입스크립트에서는 readonly 기능을 통해 타입스크립트 자체에서 error를 띄워줄 수 있다. type Cat = { readonly..
Html_css_js
2023. 1. 5. 18:00