class Abstract {constructor() {if (new.target === Abstract) {throw new TypeError("Cannot construct Abstract instances directly");}}}class Derived extends Abstract {constructor() {super();// more Derived-specific stuff here, maybe}}const a = new Abstract(); // new.target is Abstract, so it throwsconst 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
