Hello!
I have a method class element:
class Element{ constructor(element){ this.element = element; } setVisible(){ this.element.setAttribute('style', 'visibility:visible;'); } setHidden(){ this.element.setAttribute('style', 'visibility:hidden;'); } setParrent(parrent){ this.parrent = parrent; } setServerScript(script){ this.script = script; } //и т.д. очень много методов штук 100 } Various classes are inherited from it for DOM elements, in which objects, in consequence, only 20% of those methods used in the parent class are used.
The question is - is it bad in terms of code organization? Is it necessary to apply a lightweight pattern in this case, for example?
And the second question - do these unused methods eat memory? And, if, yes - how to find out how much? Preferably using google wev tools.
Thank!