Published
Edited
Nov 7, 2021
Also listed in…
Tips and Utilities
Insert cell
Insert cell
Insert cell
class Rectangle {
constructor(height, width) {
this.height = height;
this.width = width;
}
// Getter
get area() {
return this.calcArea();
}
// Method
calcArea() {
return this.height * this.width;
}
}
Insert cell
square = new Rectangle(10, 10);
Insert cell
square.calcArea()
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more