객체지향
![[TypeScript] 객체지향 프로그래밍](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbcZTkR%2FbtqZOsw53RP%2FB01jzjujDGkghFcvAJmLyk%2Fimg.png)
[TypeScript] 객체지향 프로그래밍
※ Javascript에서의 객체지향과 크게 다르지 않습니다. TypeScript만의 객체지향을 말하는것이 아니니 주의해 주세요. 1. 클래스(Class) TypeScript에서 클래스는 아래와 같이 생성합니다. class Car { color: string = 'red'; speed: number = 0; Drive(acc): void { this.speed += acc; console.log('speed : ', this.speed); }; Stop(): void { this.speed = 0; console.log('stop'); }; }; const car = new Car(); console.log(car.color); Car라는 클래스는 color와 speed라는 멤버변수와 Drive(), S..