<script>
var Person = function(name, age) {
this.name = name;
this.age = age;
}
Person.prototype.SayHello = function () {
alert(this.name + "," + this.age);
};
var Programmer = function (name, age, salary) {
Person.call(this, name, age);
this.salary = salary;
};
Programmer.prototype = new Person();
var pro = new Programmer("kym", 21, 500);
pro.SayHello();
</script>
<script> var Person = function(name, age) { this.name = name; this.age = age; } Person.prototype.SayHello = function () {alert(this.name + "," + this.age);};var Programmer = function (name, age, salary) {Person.call(this, name, age);this.salary = salary;};Programmer.prototype = new Person();var pro = new Programmer("kym", 21, 500);pro.SayHello();</script>
<script>var Person = function(name, age) {this.name = name;this.age = age;}Person.prototype.SayHello = function () {alert(this.name + "," + this.age);};var Programmer = function (name, age, salary) {Person.call(this, name, age);this.salary = salary;};
Programmer.prototype = new Person();var pro = new Programmer("kym", 21, 500);pro.SayHello();</script>
<script> var Person = function(name, age) { this.name = name; this.age = age; } Person.prototype.SayHello = function () {alert(this.name + "," + this.age);};var Programmer = function (name, age, salary) {Person.call(this, name, age);this.salary = salary;};Programmer.prototype = new Person();var pro = new Programmer("kym", 21, 500);pro.SayHello();</script>
<script>var Person = function(name, age) {this.name = name;this.age = age;}Person.prototype.SayHello = function () {alert(this.name + "," + this.age);};var Programmer = function (name, age, salary) {Person.call(this, name, age);this.salary = salary;};
Programmer.prototype = new Person();var pro = new Programmer("kym", 21, 500);pro.SayHello();</script>