& (1) 썸네일형 리스트형 Type의 확장 Typescript에서 타입지정을 위해 Type alias와 Interface를 사용할 수 있는데, 이렇게 지정된 type들을 확장하는 기능도 지원하고 있다. 어떻게 확장할 수 있는지 배워보도록 하자! Intersection interface animal { readonly name: string; age: number; } type bird = animal & { wing: number; } type alias 기능을 사용할 때는 &를 사용해 연산하듯이 두 타입을 합칠 수 있다. 이를 `intersection`이라고 부르고, interface나 type alias로 지정된 타입을 모두 결합할 수 있다. 상속 interface animal { readonly name: string; age: number.. 이전 1 다음