<script> function Person (name, age) { this.name = name; this.age = age; } Person.prototype.sayHi = function (){ alert(this.name+'=='+ this.age) } function student(name,age) { Person.apply(this, [name, age]) } student.prototype = Person.prototype; var stu = new student("zhang1",221); stu.sayHi() </script>