工厂模式
function Person(name, age){ var person = new Object(); person.name = name; person.age = age; person.printName = function(){ console.log(this.name); }; person.printAge = function(){ console.log(this.age); } return person; } var person = Person('xin',22);
.