{"size": 353, "ext": "js", "max_stars_repo_path": "045-singleton.js", "max_stars_repo_name": "looselytyped/JavaScript-Patterns-Revisited", "max_stars_repo_stars_event_min_datetime": "2016-07-08T22:27:07.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-02T17:47:59.000Z", "max_issues_repo_path": "045-singleton.js", "max_issues_repo_name": "looselytyped/JavaScript-Patterns-Revisited", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "045-singleton.js", "max_forks_repo_name": "looselytyped/JavaScript-Patterns-Revisited", "max_forks_repo_forks_event_min_datetime": "2019-12-12T15:00:00.000Z", "max_forks_repo_forks_event_max_datetime": "2019-12-12T15:00:00.000Z"}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 16.8095238095, "max_line_length": 44, "alphanum_fraction": 0.6090651558}
var Singleton;

(function() {
  var instance;
  Singleton = function(name) {
    if (instance) {
      return instance;
    }
    this.name = name;
    instance = this;
  };
  Singleton.prototype.getName = function() {
    return name;
  };
})();

var thor = new Singleton("Thor");
var evilThor = new Singleton("Thor");

console.log(thor === evilThor);
