Conclusions

In this section we reviewed several of the options available for writing modular JavaScript using modern module formats.

These formats have a number of advantages over using the module pattern alone including: avoiding the need to manage global variables, better support for static and dynamic dependency management, improved compatibility with script loaders, better compatibility for modules on the server, and more.

In short, I recommend trying out what’s been suggested in this chapter, as these formats offer a great deal of power and flexibility that can significantly assist with better organizing our applications.

Get Learning JavaScript Design Patterns 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.