Override in Javascript
<p>Func2 is called when I click on button . Why i don't get any popup? Should I see both alert alert ("override1") and alert ("override2") after the first one?</p>

<pre><code>// JavaScript Document
function person(name, surname) {
    this.name = "";
    this.surname = "";
    this.age = "11";
    this.setName(name);
    this.setSurname(surname);
    //alert('Person instantiated'); 
}
person.prototype.setName = function(name) {
    this.name = "Sir1" + name;
}
person.prototype.setSurname = function(surname) {
    this.surname = "-" + surname;
}
person.prototype.setAge = function(newAge) {
    this.age = newAge;
}
person.prototype.show = function() {
    alert("override1");
}
function employee(name, surname, company) {
    //if (arguments[0] === inheriting) return;
    person.call(this, name, surname); // -&gt; override del costruttore
    //this.name = "Sir2"+name;
    this.company = company;
};
employee.prototype.show = function() {
    person.prototype.show;
    alert("override2");
}
function test2() {
    employee.prototype = new person();
    // correct the constructor pointer because it points to Person  
    employee.prototype.constructor = employee;
    // Crea un oggetto impiegato da persona
    impiegato = new employee("Antonio", "Di Maio", "Consuldimo");
    //impiegato.show();
    impiegato.show();
}​
</code></pre>

<p>Thanks</p>
