工厂模式
var People = (function () {
var People = function (name, age, weight) {
this.name = name;
this.age = age;
this.weight = weight;
};
return function (name, age, weight) {
return new People(name, age, weight);
}
})();
var jim = new People('jim',19,50);
var tom = new People('tom',20,55);
console.log(tom.age);
console.log(jim.weight);
临时有事 下次补充。。。