Design Patterns
Singleton
class Database { url: string; static #_instance: Database constructor() { if(Database.#_instance) { return Database.#_instance; } else { this.url = Math.random() Database.#_instance = this; } } }
class Database { url: string; static #_instance: Database constructor() { if(Database.#_instance) { return Database.#_instance; } else { this.url = Math.random() Database.#_instance = this; } } }