function inhert(subType, superType) {
subType.prototype = Object.create(superType.prototype);
Object.defineProperty(subType.prototype, "constructor", {
enumerable: false,
writable: true,
configurable: true,
value: subType,
});
}
function Human(name) {
this.name = name;
this.kingdom = "animal";
this.color = ["yellow", "white", "brown", "black"];
}
Human.prototype.getName = function () {
return this.name;
};
function Chinese(name, age) {
Human.call(this,name)
this.color = "yellow";
this.age = age;
}
inhert(Chinese, Human);
Chinese.prototype.getAge = function () {
return this.age;
};