Public (1) 썸네일형 리스트형 객체 Type 알아보기 객체의 값과 속성 타입 지정하기 type Height = number; type Name = string; interface IHeightRecord { [name: Name]: Height; } type THeightRecord = { [name: Name]: Height; } const heightRecord: IHeightRecord = { '철수': 170, '영희': 160, '길동': 175 } 구체적으로 속성명과 그 속성값의 type을 정하는 것이 아니라 속성명의 type은 무엇이고, 속성값의 type은 무엇인지만 정의할 수도 있다. interface와 접근제어자 interface IAnimal { readonly name: string; age: number; } type TAnimal =.. 이전 1 다음