I'm a bit confused by how inheritance works for class properties. Here's a representative example:
class Base {
something = 1;
constructor() {
console.log(this.something);
}
}
class Child extends Base {
something = 2;
}
new Child();
this logs 1
to the terminal, where I'd expect it to log 2
.
This is just a minimal working example. My actual code is more complicated, but basically my requirements are:
Child
should have a property,- that property should be accessible in
Base.constructor
.