I'm reading Javascript Patterns recently.And I don't understand the code below when it talks about singleton pattern:
function Universe(){
var instance;
Universe=function Universe(){
return instance;
};
Universe.prototype=this;
//the new Universe below,refers to which one?The original one,
//or the one:function(){return this;} ??
instance=new Universe();
instance.constructor=Universe;
instance.bang="Big";
return instance;
}
Universe.prototype.nothing=true;
var uni=new Universe();
Universe.prototype.everything=true;
var uni2=new Universe();
uni===uni2;//true