在javascript对象中创建"静态"成员

2 javascript oop prototype web

有没有办法在JS对象中创建"静态"成员?

function Person(){

}

Person.prototype.age = null;
Person.prototype.gender = null;
Run Code Online (Sandbox Code Playgroud)

我想将personsCount添加为静态成员,这可能吗?

Shl*_*rtz 6

当然,只需添加没有原型的Person.personsCount