mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 16:42:28 +03:00
790a262c07
swc_babel_ast: - Rename as `swc_estree_ast`. swc_babel_compat: - Rename as `swc_estree_compat`. swc_babel_visit: - Rename as `swc_estree_visit`.
23 lines
400 B
JavaScript
23 lines
400 B
JavaScript
class Rectangle {
|
|
constructor(height, width) {
|
|
this.height = height;
|
|
this.width = width;
|
|
}
|
|
|
|
set height(height) { this.height = height; }
|
|
|
|
set width(width) { this.width = width; }
|
|
|
|
get area() {
|
|
return this.calcArea();
|
|
}
|
|
|
|
calcArea() {
|
|
return this.height * this.width;
|
|
}
|
|
}
|
|
|
|
const square = new Rectangle(10, 10);
|
|
|
|
console.log(square.area);
|