본문 바로가기

bkdragon's log

검색하기
bkdragon's log
프로필사진 bkdragon

  • 분류 전체보기 (91)
    • Typescript (14)
    • React (32)
    • Java Spring (5)
    • Flutter (0)
    • concept (22)
    • Thinking (2)
    • Error (1)
    • UI UX (7)
    • golang (7)
    • 이펙티브 타입스크립트 (1)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2026/04   »
일 월 화 수 목 금 토
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
  • component
  • test
  • google
  • Spring
  • 오블완
  • RTK
  • springboot
  • java
  • 티스토리챌린지
  • backend
  • Redux
  • frontend
  • css
  • typescript
  • hook
  • golang
  • Gin
  • go
  • JavaSpring
  • ReactHooks
  • designpatterns
  • satisfiles
  • tanstackquery
  • storybook
  • react-hook-form
  • React
  • Chakra
  • JPA
  • javascript
  • 웹애플리케이션서버
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록satisfiles (1)

bkdragon's log

as < satisfies

as는 타입 단언을 할 수 있는 키워드이다. 컴파일러가 추론 하지 못하는 상황에서 개발자 입장에서 확실하다고 느낄 때 사용할 수 있다. 하지만 실제로 형변환이 일어나는 것은 아니다. 코드의 런타임 동작에는 아무런 영향을 주지 않는다. const number = 10; const showValue = (value : string) => console.log(value); showValue(number as unknown as string); 문제가 있는 부분인데 빨간 줄이 안뜬다! . as는 정말 확실할 때 써야한다. const person: Record = { name: 'bk', age: 27, hobby: 'music', }; const showNumber = (value : number) => co..

Typescript 2023. 8. 4. 20:09
이전 Prev 1 Next 다음

Blog is powered by AXZ / Designed by Tistory

티스토리툴바