SOURCE


const A = (function() {
    let id = 0;

    return function() {
        this.id = id++;
    }
})();

const a = new A();
const b = new A();
console.log(a, b)
console 命令行工具 X clear

                    
>
console