I have one class and another that inherits property children from the first one.
function A() {}
A.prototype.children = [];
function B() {}
B.prototype = new A();
B.prototype.addChild = function(Child) {
this.children.push(Child);
};
var b = new B();
b.addChild(new Object());
Strangely, when dumping b
to console, it has no item in .children
(if property .children
exists at all; Chrome/Firefox), but its prototype's .children
property get populated. Why is that?