일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- git
- C#
- AI
- property
- C++
- loop
- webpack
- Clone
- security
- bash
- generic
- Python
- var
- machine learning
- scss
- vuetify
- npm
- nginx
- condition
- BOJ
- docker
- type
- leetcode
- JavaScript
- 앙상블
- TypeScript
- dotenv
- vue.js
- 보안
- VUE
Archives
- Today
- Total
목록type guard (1)
ice rabbit programming
[JS][TS] Typescript의 Decorator와 Type Guard
이전 글에서도 언급했듯이, Decorator와 Type Guard를 마지막으로 typescript 개념 정리는 1차적으로 마칠 예정이다. 추후에 다른 강의를 듣거나, 사용하다가 팁 등을 알게 되면 올릴 것 같다. Decorator Decorator는 Class, Method, Parameter, Property에 붙일 수 있는 특수한 선언이다. @를 붙여서 표현하는데, 생김새는 자바의 annotation과 흡사하다. @뒤에는 선언에 대한 정보와 함께 런타임에 호출되는 함수여야 한다. 역시 아래 코드를 보자. class decorator function hello(constructFuntion: Function) { // signature는 생성자를 인자로 지정하는 것 } function helloFact..
Development/JavaScript
2020. 12. 31. 01:47