● One global namespace
● Often inline JS code is embedded directly in HTML
● Many <script> tags with hidden ordering dependencies
● Very often spaghetti code
● OK only for very simple pages
● One global namespace
● Often inline JS code is embedded directly in HTML
● Many <script> tags with hidden ordering dependencies
● Very often spaghetti code
● OK only for very simple pages
● Script loaders/bundlers (e.g. head.js, LABjs, Rails assets)
● Single app object in the global namespace
● Better but doesn't scale well to large apps
● Otherwise plain JS files that have an exported object
● Use require('module_name') to load other modules
● Asynchronous Module Definitions (AMD)