56
rated 0 times
[
59]
[
3]
/ answers: 1 / hits: 78856
/ 9 Years ago, thu, august 13, 2015, 12:00:00
What does get
mean in this ES6 class? How do I reference this function? How should I use it?
class Polygon {
constructor(height, width) {
this.height = height;
this.width = width;
}
get area() {
return this.calcArea()
}
calcArea() {
return this.height * this.width;
}
}
More From » methods