cblupo
8/23/2017 - 6:34 PM

-

var Singleton = (function() {   OR   Singleton = function() {
  var instance;
  
  function createInstance() {
    var object = new Object("I am the instance");
    return object;
  }
  
  return {
    getInstance: function() {
      if (!instance) {
        instance = createInstance();
        
        return instance;
      }
    }
  };
}());   OR   }();