const Parent = class{
  constructor(){
    console.log('parent', new.target == Child);
  }
};
 
const Child = class extends Parent{
  constructor(){
    super();
    console.log('child', new.target == Child);
  }
};
 
new Child;
 
//parent true
//child true

ES5로 super 흉내 내보기

const Parent = function(){
  console.log('parent', new.target);
};
const Child = function(){
  this.constructor.call(this);
  console.log('child', new.target);
};
Child.prototype = Object.create(Parent.prototype);

Reflect

ES6 Reflect.constuct() 이용해서 super 흉내내보기

const Parent = function(){
 
  //new.target을 전달 받아 생성될 거라 Child를 가리킬 수 있다
  console.log('parent', new.target == Child);
 
};
const Child = function(){
 
  //1. Child의 new.target을 전달하여 Parent를 생성할 수는 있지만,
  //2. 이걸 this에 할당할 방법은 없다!
  /*this =*/ Reflect.construct(this.constructor, [], new.target);

  console.log('child', new.target == Child);
};
Child.prototype = Object.create(Parent.prototype);
 
new Child;
//parent true
//child true

HomeObject

const ParentA = class{
  methodP(){console.log('pa');}
};
const A = class extends ParentA{
  methodA(){
    super.methodP();
  }
};

const ParentB = class{
  methodP(){console.log('pb');}
};
const B = class extends ParentB{};

B.prototype.methodB = A.prototype.methodA;

const b = new B;
 
b.methodB(); //pa