ES6中实现单例模式 1、通过构造函数 class SingletonApple { constructor(name, creator) { //首次使用构造器实例 if (!SingletonApple.instance) { this.name = name;