본문 바로가기

현인

검색하기
현인
프로필사진 현인(Hyeon In)

  • HI's Dev Log (70)
    • 기술 학습 (38)
      • JavaScript (12)
      • React (3)
      • ETC (2)
      • NextJS (8)
      • Apollo-Client (0)
      • GraphQL (6)
    • CS 학습 (6)
      • 네트워크 (1)
      • WEB (5)
    • 알고리즘 (15)
    • 개발 일기 (10)
Guestbook
Recent Posts
Recent Comments
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록typescript (1)

현인

[TypeScript] interface와 type의 차이점

프로젝트를 하던 중 TypeScript의 type과 interface의 차이점이 궁금하여 알아보았다 interface는 type과 마찬가지로 객체의 타입의 이름을 지정하는 또 다른 방법이다. 확장하는 방법의 차이 interface Person { name : string, age : number } interface Student extends Person{ school : string } extends 방식 type Person = { name : string, age : number } type Student = Person & { school : string } & 활용 선언적 확장 type은 새로운 속성을 추가하기 위해서 다시 같은 이름으로 선언할 수 없지만, interface는 항상 선언적 확장..

기술 학습 2023. 3. 15. 16:32
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바