PROTOTYPAL INHERITANCE
function Person(name) {
this.name = name;
}
Person.prototype.getName = function() {
return this.name;
};
function Student(name,school) {
Person.call( this, name ); // pseudo-polymorphism
this.school = school;
}
Student.prototype = Object.create(Person.prototype);
Student.prototype.getSchool = function() {
return this.school;
};
var giamir = new Student('Giamir','TWU');
giamir.getName(); // "Giamir"
giamir.getSchool(); // "TWU"