In this chapter, we will be introduced to the concepts of Modules and Namespacing and see how they can lead to more robust implementations. We will showcase how these design principles can be used in applications, by demonstrating some of the most commonly used development patterns to create Modules in JavaScript.
In this chapter, we will:
Review the concept of Modules and Namespacing
Introduce the Object Literal Pattern
Introduce the Module Pattern and its variants
Introduce the Revealing Module Pattern and its variants
Have a small dive into ES5 Strict Mode and ES6 Modules
Explain how Modules can be used and benefit jQuery applications