DEV Community

Cover image for Abstract Classes in JavaScript

Abstract Classes in JavaScript

Fareedat Bello on January 28, 2024

In Javascript, the concept of an abstract class is not natively supported as it is in other languages such as Java, TypeScript, and Python. However...
Collapse
 
efpage profile image
Eckehard

Usually an abstract class is not meant to be instatiated, but it does not necessarily need to be protected against instatiation. If you define a class in an ES6-moduel, simply do not expose the class name. or choose a name that will not be used by accident. The risk you use such a class will be very low.