📅  最后修改于: 2022-03-11 15:01:52.262000             🧑  作者: Mango
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.