상속
클래스 상속
// Book 수퍼 클래스를 상속 받은 E_Book 클래스
class E_Book extends Book {
// paper_type 오버라이딩
paper_type = '스크린';
}// 상속 유틸리티 함수
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
// E_Book 클래스
var E_Book = /** @class */ (function (_super) {
__extends(E_Book, _super); // 수퍼 클래스 상속
function E_Book() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.paper_type = '스크린'; // 오버라이팅(덮어쓰기)
return _this;
}
return E_Book;
}(Book));상속 / constructor, super
실습
참고
Last updated
