Emmm ... See the parent-child relationship directly by testing:
class a{Constructor () {//does not have to This. Name= "Class_a"; //Console.log (This)//a {name: "Class_a"} (another line) B {name: "Class_a"}//the parent class subclasses performed a} static Staticcallnamea () {return"Name_a"; } Callnamea () {return"Name_a"; } static cover () {return"Cover_a"}}class B extends a{constructor () {//subclasses can not addSuper ();//subclasses must have //Console.log (This)//b {name: "Class_a"}//will print directly} static Staticcallnameb () {return"Nameb"; } callnameb () {return"Name_b"; } static cover () {return"Cover_b" }}
Console.log (A.name,b.name)//A B//(class name)Console.log (A.staticcallnamea (), B.staticcallnamea ())//Static subclass Inherits parent classConsole.log (A.cover (), B.cover ())//cover_a cover_b//read-ahead subclass re-read parent classConsole.log (A.STATICCALLNAMEB)//Undefined//parent class does not have subclass-specific functionsConsole.log (A.CALLNAMEA,B.CALLNAMEA)//undefined undefined//non-static method class cannot be called directlyLet a=NewA (), b=NewB//add no parentheses to the same effectConsole.log (A.name);//class_aConsole.log (A.name,b.name)//class_a class_aConsole.log (A.callnamea (), A.callnameb,b.callnameb (), B.callnamea ())//name_a undefined name_b name_a//Description inheritance relationship Ibid .
Welcome to the Great God of guidance ...
Js__class into the pit Chrome tests class parent-child inheritance relationships