The Singleton pattern is to ensure there is only one instance of the class that exists. In the case it does exist it returns a reference to that object. This is normally achieved by a method belonging to the class to create an instance.
Example are written in ES2015 syntax.
Maybe you want to have private fields and functions? These can be encapsulated inside of a closure and return a object literal to expose the public interface.
Another technique is to instantiate the class when it’s needed which can help save on resource: