var body = { //类
create: function(name, age){
this.name = name,
this.age = age
},
sayName: function(){
console.log(this.name);
},
sayAge: function(){
console.log(this.age);
},
country: 'china'
}
function NEW(Class, param){ //创建对象的方法
function _new(){
Class.create.apply(this, param);
}
_new.prototype = body;
return new _new();
}
var obj = NEW(body, ['ly', 12]);