function people(name,sex,age){
this.name=name
this.sex=sex
this.age=age
}
people.prototype.move=function(){
console.log(this.name+"正在移动")
}
people.prototype.eat=function(){
console.log(this.name+"正在吃")
}
function teach(name,sex,age){
}
teach.prototype=new people("李四","男","34")
teach.prototype.pigai=function(){
console.log(this.name+"正在批改作业")
}
var s1=new teach("张三","男","30");
console.log(s1.name)
s1.move()
先从自身的构造函数中找move()方法,没找到则从对象的原型上找,再没找到从people的构造函数中找,之后再找people对象的原型,直到找到就停止