SOURCE

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()
console 命令行工具 X clear

                    
>
console