var Common={
data:100,
conf:{},
init:function(param){
this.conf=param;
},
say:function(){
console.log('say : '+ this.data+this.conf);
}
};
function Some(param){
this.init(param);
}
Some.prototype=Common;
function Factory(param){
return new Some(param);
}
var a =Factory({a:100,b:200});
a.say();
console.log("\n--------");
console.log(a.config);
想实现的是缺省值由Common提供 ,在Factory每次new的时候能够动态传入参数,但是 a.say执行有结果,但是打印 a.conf却是空