CLASS (1) 썸네일형 리스트형 [Typescript] 클래스(Class) ↓ 클래스에 대한 개념이 없다면 참고 https://winterflower.tistory.com/178 타입스크립트에서 클래스를 작성할 때는 멤버 변수를 미리 선언해주어야 한다. class car{ color: string; constructor(color: string){ this.color = color; } start(){ console.log("start"); } } const bmw = new Car("red"); 멤버 변수를 미리 선언하지 않는 방법도 있다. 접근 제한자나 readonly 키워드를 이용하면 된다. class car{ constructor(public color: string){ this.color = color; } start(){ console.log("start"); } }.. 이전 1 다음