본문 바로가기

Den`s blog

검색하기
Den`s blog
프로필사진 shinYeongHyeon

  • 분류 전체보기 (73)
    • Docker (9)
    • Terraform (2)
    • GoLang (19)
    • Typescript (1)
    • NestJS (2)
    • GraphQL (2)
    • Database (3)
    • Javascript (4)
    • ReactJS (4)
    • Svelte (15)
    • Git (6)
    • Etc (5)
    • Management (1)
Guestbook
Notice
  • About
Recent Posts
Recent Comments
Link
  • gitHub
«   2025/08   »
일 월 화 수 목 금 토
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
  • Terraform
  • GraphQL
  • golang
  • PostgreSQL
  • react
  • onDestory
  • 도커
  • go
  • Svelte LifeCycle
  • githook
  • ...$$restProps
  • JavaScript
  • 인라인핸들러
  • testing
  • reactjs
  • bitwiseNot
  • nestjs
  • GIT
  • IAC
  • TypeScript
  • smui
  • cron
  • mock
  • docker
  • docker-network
  • svelte
  • :=
  • 번역
  • 도커컨테이너
  • apiTest
more
Archives
Today
Total
Bio
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Typescript (1)

Den`s blog

Indexable

코드의 실행시점에서만 알 수 있는 Type/Key 들이 있는데, 이를 정의를 하고 싶다, 꼼꼼해지려면 뭐 예를 들어 오브젝트를 받긴 할건데 이 것의 값들이 동적으로 변해야하는 상황 (예를 들면 여러 API 를 통합하는 것이 될 수 있다) 그럴 때 사용할 수 있는 것이 Indexable 이다. 코드부터 보고 시작하자. interface Indexable { [key: string]: any; } Index Signature [] 로 감싸주면 된다. const indexable: Indexable = { test1: 1, test2: 2, test3: 3, }; Object.keys(indexable).forEach((k) => console.log(indexable[k])); // 1, 2, 3 해당 문법..

Typescript 2021. 1. 30. 14:40
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바