2 ms·
Static 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
by galaxyLogic 8y ago
Static 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.