Design Pattern: Singleton Pattern in TypeScript

Singleton pattern is used to ensure that only one instance of a class is created in any case, and whenever you want to get an instance of that class, then the same object instance is returned.