[TS] 인터페이스로 구현하는 클래스 (implements)
TIL
타입스크립트의 인터페이스는 클래스의 설계도 역할을 할 수 있다.다음과 같이 인터페이스를 이용해 클래스에 어떤 필드들이 존재하고, 어떤 메서드가 존재하는지 정의할 수 있다.interface CharacterInterface { name: string; moveSpeed: number; move(): void;}class Character implements CharacterInterface { constructor( public name: string, public moveSpeed: number, ) {} move(): void { console.log(`${this.moveSpeed} 속도로 이동!`); }} 인터페이스 CharacterInterface는 name, move..