class Clovek {
static getCounter() {
return Clovek.people_count
}
constructor(name, age) {
this.name = name
this.age = age
Clovek.people_count++
}
whoami() {
console.log(`Hello, I am ${this.name}. I am ${this.age} years old.`)
}
}
Clovek.people_count = 0
const dan = new Clovek("Daniel", 31)
dan.whoami()
const simon = new Clovek("Simon", "?")
simon.whoami()
console.log(`People count: ${Clovek.getCounter()}`)