An intro to JavaScript Modules

Modules divide programs into clusters of code that, by some criterion, belong together. Most programming languages have a scope level between global (everyone can see it) and local (only this function can see it). JavaScript does not. The only way to create a new scope in JavaScript is with a function. Hence, modules are god sent.