logo

Crowdly

Browser

Add to Chrome

Що виведе цей код? class AbstractShape { constructor() { if (new.target ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Що виведе цей код?
 class AbstractShape {

constructor() {

if (new.target === AbstractShape) {

throw new Error('Cannot instantiate abstract class');

}

}

area() {

throw new Error('Method area() must be implemented');

}

}

class Rectangle extends AbstractShape {

constructor(w, h) {

super();

this.w = w; this.h = h;

}

area() { return this.w \* this.h; }

}

const r = new Rectangle(4, 5);

console.log(r.area());

0%
0%
0%
100%
More questions like this

Want instant access to all verified answers on elr.tnpu.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome