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
- Filter
- interface
- set
- array
- Spring
- map
- materialicons
- 타입스크립트
- TS
- reactnative
- err_connection_refused
- 슬라이딩윈도우
- Next.js
- app.post
- 이진탐색
- 스크롤이벤트
- npm에러
- forwardref type
- javascript
- generic
- 상속
- 안드로이드빌드에러
- 배열중복요소제거
- 리액트네이티브아이콘
- app:compiledebugkotlin
- react
- mainapplication.kt
- async
- reactnative error
- extends
Archives
- Today
- Total
목록class field (1)
rhanziy
TS - class의 타입지정
object 뽑는 기계 class에도 타입을 지정해줄 수 있다. ES6 신문법에서는 constructor함수를 쓰면 되는데, this.어쩌구를 쓰고 싶으면 미리 어쩌구를 필드값으로 지정해 줘야함. class CarInfo { model : string; price : number; constructor(a:string, b:number){ this.model = a, this.price = b } tax() :number{ return this.price * 0.1; } } let car = new CarInfo('소나타', 3000); console.log(car); // { model : '소나타', price : 3000 } console.log(car.tax()); // 300 필드값으로 mode..
Html_css_js
2023. 1. 27. 17:05