Menu
So I’m doing some inheritance:
[CODE]First = function()
{
this.type = “First”;
}
Second = function()
{
this.type = “Second”;
alert(“Second: this.constructor: n”+this.constructor);
}
Second.prototype = new First();
onload = function()
{
var test = new Second();
}
Now… can someone explain to me why the above displays:
[QUOTE]
Second: this.constructor:
function()
{
this.type = “First”;
}
Seems a little odd to me!
Oh, and if I move the alert to the onload function instead and alert(test.constructor) I still get the same thing. It still thinks the constructor is First instead of Second.
Thanks!