class Rectangle {
constructor(width, height) {
this.width = width;
this.height = height;
}
getArea() {
return width * height;
}
}
const rect = new Rectangle(5, 10);
console.log("Area:", rect.getArea());
const createCounter = () => {
let count = 0;
return () => {
console.log(count++);
};
};
const counter1 = createCounter();
const counter2 = createCounter();
counter1();
counter2();