type1 [Typescript] Type과 interface의 차이 interface ExampleInterface1 extends ExampleInterface2 { age: number; } type ExampleType1 = ExampleType2 & { age: number; }; interface의 경우 extends로, type은 &으로 확장 interface ExampleInterface { id: number; name: string; } interface ExampleInterface { age: number; } Interface는 동일한 이름으로 다시 선언하여 확장이 가능 type GenericType = { [x: string]: number }; type NormalType = { x: number }; const obj1: NormalType =.. 2021. 7. 22. 이전 1 다음