📜  javascript 获取类的所有实例 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:52.262000             🧑  作者: Mango

代码示例1
MyClass.allInstances = [];
MyClass.allInstances.push(this);
//However, you need some way to figure out when to remove instances from this array, or you'll leak memory.