原文点这
Code:
function Obj(){
this.inUse = false;//如果对象当前正在使用中,则为true
/*设置不在使用中的对象的默认值*/
this.init = function(/*values*/){
/*初始化代码*/
};
/*产生一个对象用以使用*/
this.spawn = function(/*values if any*/){
/*code to set values if any*/
this.inUse = true;
}
原文点这
Code:
function Obj(){
this.inUse = false;//如果对象当前正在使用中,则为true
/*设置不在使用中的对象的默认值*/
this.init = function(/*values*/){
/*初始化代码*/
};
/*产生一个对象用以使用*/
this.spawn = function(/*values if any*/){
/*code to set values if any*/
this.inUse = true;
}