class Singleton{ private static instance: Singleton; //Propiedad de la clase public random:number; // Propiedad del objeto private constructor(){ this.random = Math.random(); } public static getInstance():Singleton{ if(!this.instance){ this.instance = new Singleton(); } return this.instance; } }