class Rectangle { constructor(a, b) { this.a = a; this.b = b; } getArea() { return this.a * this.b; } } const r = new Rectangle(2, 3); console.log(r.getArea());