// 動物類 function Animal() { this.age = 34 } // 貓類 function Cat() { this.name = "lucy" } //把貓類原型指向動物類 這一步讓貓類間接繼承了動物類的屬性、方法 Cat.prototype = new Animal() var cat = new Cat()