Another thing you can do is nest functions. Let's say you have a function that needs to use several other "helper" functions that aren't used outside the main function. You can nest the helper functions inside the main function to "hide" them away from the other code, and also keep things organized. Two downsides to this: one is that if you end up needed to use a helper function elsewhere you'll have to change that organization strategy, and two, every time you call that main function, those nested functions have to be recreated, which is slower than if they are created once at the top level.
I do think splitting up functions by functionality into different files can be helpful. Just keep in mind that you still only have one global space! So don't forget about global variable names potentially clashing etc. That's one reason why keeping global variables at the top of your file can be helpful (so it's easy to see what they are across multiple files).
), you'll find you group your code into modules, which can help organize.
Also, check out RequireJS (http://requirejs.org
) which provides a way to create modules also. As I mentioned in another thread, ECMAScript 6 will have modules, but it's not likely these will be available in the core language in browsers for at least a couple more years, so using a library like RequireJS in the meantime can help.