I am immersed in the new Javascript ES6 classes, and I cannot understand why these class definitions do not use commas, as in object literals.
Example from MDN:
class Polygon {
constructor(height, width) {
this.height = height;
this.width = width;
}
get area() {
return this.calcArea();
}
calcArea() {
return this.height * this.width;
}
}
This is not a real problem, but I feel that something is missing. Thanks for any direction!
source
share