// 动物类 function Animal() { this.age = 34 } // 猫类 function Cat() { this.name = "lucy" } //把猫类原型指向动物类 这一步让猫类间接继承了动物类的属性、方法 Cat.prototype = new Animal() var cat = new Cat()