function New(oClass,oParams) {
function new_(){
oClass.Create.apply(this,oParams);
};
new_.prototype = aClass;
return new new_();
};
===================使用=======================
var Person = {
Create:function(name,age) {
//todo
},
someMthod() {
//todo
}
};
var billGate = New(Person,["billGate",74]);
billGate.someMethod();
时间: 2024-10-08 22:32:14