Parent and child constructors
if I have a UserForm class:
and a View class:
Does anyone know why
My best guess is that behind the scenes
and a View class:
Does anyone know why
new UserForm('root') causes the UserForm class to inherit the View constructor and set the parentElement variable correctly? Definitely wasn't the behavior I was expecting My best guess is that behind the scenes
UserForm is creating a new object from the View's prototype, and because one isn't present in the UserForm class it inherits it rather than overriding it if it had been explicitly provided - that would also explain why I don't have to call super in this case to set View properties? This is all a guess though, it's been a while since I've looked at prototype inheritance, and this seems like a bit of an edge case that's not included often