// 动物类
function Animal() {
this.age = 34
}
// 猫类
function Cat() {
this.name = "lucy"
}
//把猫类原型指向动物类 这一步让猫类间接继承了动物类的属性、方法
Cat.prototype = new Animal()
var cat = new Cat()
来源:51CTO
作者:喝醉的熊
链接:https://blog.51cto.com/13550695/2462585