标签:
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();
201606011000_《JavaScript通用的创建函数》
标签:
原文地址:http://www.cnblogs.com/beesky520/p/4543323.html