I have this:
const util = require('util');
function Parent() {}
Parent.prototype.container = {}
function Child() {
Parent.call(this);
}
util.inherits(Child, Parent);
Child.prototype.container['field'] = function(){}
Parent's prototype.container
shouldn't have a .field
property, right?
Interestingly, if you add another child, like so:
function AnotherChild() {
Parent.call(this);
}
util.inherits(AnotherChild, Parent);
... it will also have the .field
property, from the first Child
.
wat.