본문 바로가기 메뉴 바로가기

라쿤의 끄적끄적

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

라쿤의 끄적끄적

검색하기 폼
  • All (240)
    • Dev (224)
      • DataStructure (7)
      • Algorithm (5)
      • Git (8)
      • TypeScript (7)
      • JavaScript (36)
      • Bundler (2)
      • SCSS (2)
      • CSS (10)
      • React (24)
      • Redux (8)
      • web (8)
      • Python (15)
      • Django (6)
      • Node.js (6)
      • 백준 (5)
      • Design Pattern (1)
      • Racstagram_V2 (39)
      • Racstagram_V1 (16)
      • Romentum (4)
      • Starbucks (5)
      • Paint-Up (6)
      • 포트폴리오(VRCode) (1)
      • 기타 (3)
    • 금융 (1)
    • 취미 (15)
      • 러닝 (14)
      • 카페 (1)
      • 맛집 (0)
  • 방명록

Generic (1)
20210512 TypeSciprt 07 Generic : array, tuple, function (type alias, interface), class, extends, keyof, generic 관계성(union type 문제 해결법)

TypeScript07 Generic 어떤 함수에서 들어오는 매개변수에 대한 type과 return type에 대한 일정한 규칙 및 관계를 같게 하기 위해서 사용 계속 똑같은 로직이지만 들어오는 type이 변하는 경우 type에 따른 return type을 나타낼때, type에 따른 함수를 개별적으로 반복적으로 만드는 것은 비효율적이다. 그래서 type을 변수로 사용하여 들어오는 type에 따라 동적으로 사용하고 싶을 경우 문제의 시작 같은 로직이지만 들어오는 type 만 다른 경우 -> 중복의 증가 function helloString(message: string): string { return message; } function helloNumber(message: number): number { r..

Dev/TypeScript 2021. 5. 12. 19:17
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • TypeScirpt
  • Firebase
  • todolist
  • 오버라이딩
  • React
  • project
  • Git
  • instagram
  • css
  • Django
  • 기능추가
  • redux-toolkit
  • 드림코딩
  • async
  • NomadCoder
  • 바닐라js
  • hooks
  • github
  • Python
  • nrc
  • nodejs
  • 트위터 클론
  • JavaScript
  • Class
  • RUBY
  • 생활코딩
  • object
  • html
  • instagram CSS
  • 그림판 만들기
more
«   2026/01   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바