I use one js file for different pages of the site. There is a problem. Not all features are needed on every page. Therefore, after connecting the script, I insert and write what functions I need.
But when I watch other people's scripts, I never see such inserts. How to connect functions to the page?
Note: my code usually looks like this
<script src="code.js"></script> <script> toDoSome(); toDoSome1(); ... </script>