js模式(一):单例模式

function Universe(){
var instance;
Universe = function (){
return instance;
}
Universe.prototype = this;
console.log(Universe);
instance = new Universe();
instance.constructor = Universe; instance.start_time = 0;
instance.bng ="dd";
return instance;
} Universe.prototype.nothint = 1;
console.log(Universe);
var a = new Universe();
console.log(Universe);
var b = new Universe();

单例模式

上一篇:jgrid 选择器 C#控件


下一篇:C#DbHelperOleDb,Access数据库帮助类