CLASS 썸네일형 리스트형 [JavaScript] 클래스 클래스ES6(ECMAScript 2015)부터 도입된 `class` 키워드를 사용하여 클래스를 정의할 수 있습니다.클래스를 활용하여 객체 지향 프로그래밍의 개념을 자바스크립트에서 구현할 수 있습니다. 클래스 상속class Rectangle extends Shape { constructor(color, width, height) { super(color); this.width = width; this.height = height; } getArea() { return this.width * this.height; }}const rect1 = new Rectangle("blue", 10, 20);console.log(rect1.getColor()); // blue`extends.. 더보기 이전 1 다음