1. <script>
    2. function Person(name,age){
    3. this.name=name;
    4. this.age=age;
    5. }
    6. function Teacher(name,age,skill){
    7. // var self=this;
    8. // console.log(self);
    9. Person.call(this,name,age); //call能够实现属性的继承
    10. this.skill=skill;
    11. }
    12. var t=new Teacher("zhang",18,"js");
    13. console.log(t);
    14. </script>