JavaScript Design Patterns : Singleton Pattern
Published in
4 min readOct 23, 2022
Singleton pattern: limit the number of class instantiations to only one time, a class has only one instance, and provide a global access point to access it.
The Singleton pattern is a type of creational design pattern. For scenarios where only one object is required globally, such as thread pool, global cache, window object, etc.