Singleton in JavaScript

1 Β· Minko Gechev Β· April 16, 2014, midnight
Wikipedia describes the singleton design pattern as: The singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects. The term comes from the mathematical concept of a singleton....