class S { constructor() { console.log(new.target) } } class A { constructor() { console.log(new.target.name); } } class B extends A{ constructor() { super() console.log(new.target.name); } getName(){ console.log(new.target) } } let s = new S()//class S { constructor() { console.log(new.target) } } let a = new A() let b = new B() b.getName()