Tag Archives: singleton

Singleton pattern in Javascript

If you’d like to create just one instance of a Class, you’d better use this singleton pattern: var singleton = function() { /* Private variables */ var privateVariable; /* Private methods */ function privateFunction(x) { // do something here… } … Continue reading

Tagged , , | 1 Comment