child extended class method calls its super version but that still only sees child data
问题 class B extends class A. I'll call A the parent and B the child. Both have constructors. B calls super() inside of its constructor. Both have a method with the same name. Perhaps just by coincidence or mistake both have a 'this.x' variable. There then becomes no way to access the parent's this.x variable. It then becomes a point of perhaps unintended communication between the child and parent. class A { constructor(){ this.x = "super x!"; } logx(){ console.log(this.x); } } class B extends A{