Original Link: http://css-tricks.com/how-do-you-structure-javascript-the-module-pattern-edition/

JavaScript is interesting in that it enforces no particular structure upon you. “Bring Your Own Organization”, if you will. As I write more and more JavaScript in web app sites, this becomes more and more interesting. How you structure your JavaScript is very important because:

Done right, it makes code easier to understand for others and yourself re-visting your own code.

Having a decided-upon structure helps keep future code clean and encourages your declared best practices.
It makes your code testable.

Before I go any further, let it be known that I am far from a master of JavaScript. There are a lot of smart folks in the JavaScript world that have been doing and talking about this for longer than I knew what a div was