<SCRIPT type="text/javascript">
Code
var Person = function (name)
{
this.name = name;
this.ShowName = function()
{
alert(this.name);
}
};
var Employee = function(name,salary)
{
this.salary = salary;
Person.apply(this,new Array(name));
};
Employee.prototype = new Person();
Employee.prototype.ShowSalary = function()
{
alert(this.name + " $" + this.salary);
};
var BillGates = new Person("Bill Gates");
var SteveJobs = new Employee("Steve Jobs", 1234);
BillGates.ShowName();
SteveJobs.ShowName();
SteveJobs.ShowSalary();
</script>