父类构造函数
function Animal(){
this.species ='动物';
}
字类构造函数
function Cat(name){
Animal.call(this,arguments);
this.name=name;
}
创建字类对象调用父类中的方法,看看效果
var a = new Cat("xiaohua");
console.log(a.name);
console.log(a.species);
得到结论,在字类中加上一行代码即可,将call换成apply 也可以。