Object Creation Methods
What inheritance pattern is demonstrated?
class Component {
constructor() {
if (this.constructor === Component) {
throw new Error('Abstract class');
}
}
operation() {
throw new Error('Abstract method');
}
}
class ConcreteComponent extends Component {
operation() {
return 'ConcreteComponent';
}
}