본문 바로가기

뉴히의 개발 로그

검색하기
뉴히의 개발 로그
프로필사진 뉴히

  • 분류 전체보기 (144)
    • 개발일지 (101)
      • TIL (85)
      • WIL (15)
      • KPT (1)
    • HTML&CSS (0)
    • Javascript (5)
    • React (4)
    • Redux Tookit (1)
    • Supabase (4)
    • Git (6)
    • Style (1)
    • CS (6)
    • Algorithm (6)
    • TIP (8)
Guestbook
«   2025/07   »
일 월 화 수 목 금 토
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
Archives
Today
Total
Recent Posts
Recent Comments
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Generics (1)

뉴히의 개발 로그

[TIL]20230801 - typescript generics 타입선언, type/interface

제네릭 타입 선언 type SuperPrint = (a: T[]) => T const superPrint : SuperPrint = (a) => a[0] const a = superPrint([1, 2, 3, 4]) const b = superPrint([true, false, true]) const c = superPrint(["a", "b", "c"]) const d = superPrint([1, 2, true, false, "hello"]) function superPrint(a: T[]){ return a[0] } const a = superPrint([1, 2, 3, 4]) // 안써주면 타입스크립트가 알아서 유추함 const b = superPrint([true, false, true]) co..

개발일지/TIL 2023. 8. 1. 20:39
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바