JSFiddle - React, Tailwind, and code Playground
JavaScript
let User = (quantity => class User {
constructor(name, type = 'simpleUser') {
this.name = name;
this.type = type;
this.id = quantity;
quantity++;
}
})(0)
let hello1 = new User('Zed');
let hello2 = new User('Alpha');
let hello3 = new User('Omega');
alert(hello1.id);
alert(hello2.id);
alert(hello3.id);