作业 画出原型链
//动物--->人---->老师---->坏老师
function Animal(){
this.gender = "male";
}
var animal=new Animal();//实例化
Human.prototype = new Animal();
Human.prototype.constructor = Human;
function Human(){
this.actionWay = "走路";
}
Teacher.prototype = new Human();
Teacher.prototype.constructor = Teacher;
function Teacher(){
this.skill = "教书";
}
BadTeacher.prototype = new Teacher();
BadTeacher.prototype.constructor = BadTeacher;
function BadTeacher(){
this.name = "俞敏洪";
}
var t = new BadTeacher();
console.log(t);
console.log(t.name);
console.log(t.skill);
console.log(t.actionWay);