Chapter 8. Modular Programming

Modular programming is one of the most important and frequently used software design techniques. Unfortunately, JavaScript didn't support modules natively that lead JavaScript programmers to use alternative techniques to achieve modular programming in JavaScript. But now, ES6 brings modules in to JavaScript officially.

This chapter is all about how to create and import JavaScript modules. In this chapter, we will first learn how the modules were created earlier, and then we will jump to the new built-in module system that was introduced in ES6, known as the ES6 modules.

In this chapter, we'll cover:

  • What is modular programming?
  • The benefits of modular programming
  • The basics of IIFE modules, AMD, UMD, and CommonJS
  • Creating ...

Get React: Building Modern Web Applications 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.