How can I make this code cleaner ?
Hello, How do I make this code cleaner ?
I have main js file and this dom manipulation js file which I export to main js file.
Should I declare dom variables inside functions they are used in instead of putting them on top of file?
Is it correct to have init() function, like in my code, which holds other functions and then export it to main js file and call it there?
All recommendations are welcome, thanks !
I have main js file and this dom manipulation js file which I export to main js file.
Should I declare dom variables inside functions they are used in instead of putting them on top of file?
Is it correct to have init() function, like in my code, which holds other functions and then export it to main js file and call it there?
All recommendations are welcome, thanks !


