function Teacher(){
this.mSkill="JS/JQ";
this.success={
alibaba:"28",
tencent:"30"
}
}
var teacher=new Teacher()
Student.prototype=teacher
function Student(){
this.pSkill="HTML/CSS"
}
var student=new Student()
student.success.baidu='100'
console.log(teacher,student)
运行结果