Before we start,
I believe you already know:
- JS Functions; anonymous functions; self-executing functions (read here).
Applications in real life are big enough. That means thousands lines of code. If all they were in one file, it would be really hard to handle it.
The obvious solution is divide the code in several files. There are some pitfalls here: