SOURCE

function Person(name = 'people') {
    if (typeof Person.instance === 'object') {
        return Person.instance;
    }

    console.log('init Person...')

    this.name = name;

    Person.instance = this;
}

var person1 = new Person();
var person2 = new Person();
console.log(person1 === person2)
console 命令行工具 X clear

                    
>
console