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
- interface
- app:compiledebugkotlin
- 타입스크립트
- array
- 리액트네이티브아이콘
- async
- Spring
- npm에러
- Next.js
- javascript
- set
- map
- Filter
- TS
- 스크롤이벤트
- extends
- mainapplication.kt
- generic
- reactnative
- 이진탐색
- app.post
- 안드로이드빌드에러
- 슬라이딩윈도우
- forwardref type
- err_connection_refused
- 상속
- 배열중복요소제거
- materialicons
- react
- reactnative error
Archives
- Today
- Total
목록ts class (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