3 ms·
Constructors Considered Harmful
- galaxyLogic 8y agoStatic methods (in JavaScrip/ES6) can do the same thing as user-defined constructors more flexibly since they do not need to call the super-constructor. Having to call the super-constructor is a form of data-dependency between the super-class and sub-class, which can be avoided by defining static methods instead of custom constructors.