union (1) 썸네일형 리스트형 TypeScript: typeAlias vs interface 타입스크립트에서는 타입을 명시하기위해서 두가지 방법을 사용한다. 문법적으로 비슷하지만 약간다르고 지원하는 내용도 차이가 있다. 다음과 같은 News와 NewsFeed 타입으로 명시하겠다. typeAlias type News = { id: number; time_ago: string; title: string; url: string; user: string; content: string; } type NewsFeed = & News { commnets_count: number; points: number; read?: boolean; } interface interface News { id: number; time_ago: string; title: string; url: string; user: stri.. 이전 1 다음