class Company {
totalEmployees: number;
private static instance: Company;
private constructor(total: number) {
this.totalEmployees = total;
}
static getInstance() {
if(this.instance) {
return this.instance;
}
this.instance = new Company(500);
return this.instance;
}
}
const company = Company.getInstance();