JavaScript Design Patterns : Singleton Pattern

Maxwell
Level Up Coding
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.

Features

--

--

A front-end enthusiast, a development engineer willing to learn more about development techniques and collaborate to build better software.