//工厂函数创建对象 function user(name,age){ return{ name, age, show(){ console.log(`${this.name}-hsr-${this.age}`); } } } let xj=user("hundsun",12); xj.show(); let xj1=user("hundsun",11); xj1.show();