对于对象公有的属性,会造成内存的浪费
    解决:公有的属性或者公有的方法放在原型对象上

    1. function Person(name, age) {
    2. this.name = name;
    3. this.age = age;
    4. }
    5. Person.prototype.eat = "水果"
    6. var p = new Person("li", 19)
    7. var zhang = new Person("zhang", 20)
    8. console.log(p)
    9. console.log(zhang)