1. class Abstract {
    2. constructor() {
    3. if (new.target === Abstract) {
    4. throw new TypeError("Cannot construct Abstract instances directly");
    5. }
    6. }
    7. }
    8. class Derived extends Abstract {
    9. constructor() {
    10. super();
    11. // more Derived-specific stuff here, maybe
    12. }
    13. }
    14. const a = new Abstract(); // new.target is Abstract, so it throws
    15. const b = new Derived(); // new.target is Derived, so no error

    https://stackoverflow.com/questions/29480569/does-ecmascript-6-have-a-convention-for-abstract-classes
    https://blog.csdn.net/Lyb__/article/details/109350433