4
类中函数之前的“ get”关键字是什么?
get这个ES6课程是什么意思?如何引用此功能?我应该如何使用? class Polygon { constructor(height, width) { this.height = height; this.width = width; } get area() { return this.calcArea() } calcArea() { return this.height * this.width; } }
106
javascript
methods
getter