Is there some way to access a class variable in the constructor?
var Parent = function() {
console.log(Parent.name);
};
Parent.name = 'parent';
var Child = function() {
Parent.apply(this, arguments);
}
require('util').inherits(Child, Parent);
Child.name = 'child';
i.e Parent's constructor should log "parent" and child's Constructor should log "child" based one some class variable in each class.
The above code doesn't work as I expect.