Differentiating modules, libraries, and frameworks
While working on JavaScript applications, we rely on modules, libraries, and, of course, the larger frameworks. These structures can originate from internal and external sources, meaning they are either written by you or your team or are a dependency that is written by someone else. JavaScript, specifically, is in a unique position where modules, libraries, and even frameworks can be used on browser and server environments. For framework developers, it is important to know how to work with these JavaScript structures, because frameworks heavily rely on defining and using modules and libraries. These abstractions and structures allow for better code organization, which we will be discussing in the next subsections.
Modules
Developers create their own modules to separate the code into multiple files or logical blocks. In a similar manner, modules can be imported from external sources. The module encapsulation wraps a block of code...