Chapter 11. Code modularization techniques

This chapter covers

  • Using the module pattern
  • Using current standards for writing modular code: AMD and CommonJS
  • Working with ES6 modules

So far we’ve explored the basic primitives of JavaScript, such as functions, objects, collections, and regular expressions. We have more than a couple of tools in our belt for solving specific problems with our JavaScript code. But as our applications start to grow, another whole set of problems, related to how we structure and manage our code, starts to emerge. Time and time again, it’s been proven that large, monolithic code bases are far more likely to be difficult to understand and maintain than smaller, well-organized ones. So it’s only natural that one way ...

Get Secrets of the JavaScript Ninja, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.