I've decided to write more OOP articles in WinJS library regarding the use of Design Patterns we all love! You can learn my previous parts:
Let's start with what this design pattern means.
What is Singleton Design Pattern?
Singleton is one of the most widely used design patterns in Javascript. It mainly creates only one instance of the object which lets you call it globally.
If you want to declare global variables across the js app,Singleton pattern is just for you
According to DoFactory,Singleton Pattern includes only one object:
Singleton object defines a function named getInstance() which returns you a unique instance.
getInstance implements another pattern named "Lazy Load".
What is Lazy Load?
Lazy Load checks if an object's instance has already been created if not it creates one immediately.This is called Lazy Load.
Singleton object defines a function named getInstance() which returns you a unique instance.
getInstance implements another pattern named "Lazy Load".
What is Lazy Load?
Lazy Load checks if an object's instance has already been created if not it creates one immediately.This is called Lazy Load.
Since there's only one object, why don't we simply implement it?
Implementation

Vignesh ManiPosted May 30, 2016, 9:29 AM
Nice one
Thiruppathi RPosted May 30, 2016, 1:40 AM
Easiest methods to understand..
Debasis SahaPosted May 30, 2016, 1:14 AM
Nice share..