Really getting into web development and in particular JS so I was wondering what were the best practices in terms of JS file organization and delegation of responsibilities. I a
The best way to handle multiple JavaScript files is to design them like modules. One main JavaScript file should act as a sort of bootloader which kicks off things by setting up your "namespace" (quoted since JavaScript doesn't have classes). Example:
var myNamespace = {};
In each of your modules, you extend the "namespace". This has two benefits:
Also see this for implementation details: https://stackoverflow.com/a/3722845/221061