Singleton in Javascript

var universe;
(function() {
  var instance;
  universe = function universe() {
    if (instance) {
      return instance;
    }
    instance = this;

    this.start_time = 0;
    this.bang = "Big";
  };
}());

Share and Enjoy !

0Shares
0 0 0