JavaScript Module Pattern

The Javascript module is a great design pattern for Javascript coders. It makes code simple to read and easy to use. It allows you to hide private methods inside your module and expose public properties that you want to expose when you use the Revealing Module Pattern. More importantly you can say bye bye to prototype bloat hell…

Here are a number of useful resources and links for building Javascript modules:

  1. How Do You Structure JavaScript? The Module Pattern Edition
  2. JavaScript module pattern with example
  3. Mastering the Module Pattern

In this book, we will take a look at a number of popular JavaScript design patterns and explore why certain patterns may be more suitable for your projects than others. Remember that patterns can be applied not just to vanilla JavaScript, but also to abstracted libraries such as jQuery or Dojo as well.

Essential JavaScript Design Patterns For Beginners

An online book that covers design patterns for JavaScript by example.