드리프트의 뉴 코딩 이야기
close
프로필 배경
프로필 로고

드리프트의 뉴 코딩 이야기

  • 분류 전체보기 (416)
    • Javascript (177)
    • Go (143)
    • Rust (33)
    • Python (31)
    • Docker (5)
    • Codings (10)
    • Linux (5)
    • Flutter (3)
    • Etc (9)
  • 홈
  • Javascript
  • Go
  • Rust
  • Python
TypeScript에서 더블 어설션(Double Assertion) 이해하기: 안전하게 타입 변환

TypeScript에서 더블 어설션(Double Assertion) 이해하기: 안전하게 타입 변환

TypeScript에서 더블 어설션(Double Assertion) 이해하기: 안전하게 타입 변환TypeScript에는 "더블 어설션(Double Assertion)"이라는 기능이 있습니다. 가능하면 사용을 피하는 것이 좋지만, 하나의 기술로서 알아두면 유용할 것 같습니다. 어설션(Assertion)이란?어설션(Assertion) 자체가 타입을 강제로 변환하는 기능인데요, 아래의 예제를 통해 이해해볼까요?type User = { id: string; name: string; isAdmin?: boolean;}type AdminUser = User & { isAdmin: true;}function userToAdminUser(user: User): AdminUser { user.is..

  • format_list_bulleted Javascript
  • · 2024. 9. 20.
  • textsms
  • navigate_before
  • 1
  • navigate_next
태그
  • #프로그래밍
  • #자바스크립트
  • #Golang
  • #Go 언어
  • #javascript
  • #성능 최적화
  • #Rust
  • #타입스크립트
  • #typescript
  • #Go
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바