Now that we’ve seen the simple module pattern as well as ways to augment it, we should take a look at one final piece of the puzzle. […]
READ MORELast time I talked about the simple module pattern. This is where you create a function that returns an object with behavior and state and that behavior and state is implemented (and made private) by using a closure. We showed this by using the module pattern to create a stopwatch object. […]
READ MOREIf you recall, JavaScript closures are an extremely powerful concept in the language. By using JavaScript’s rather peculiar scoping rules, closures are a way of creating private variables and functionality for an object. The module pattern builds upon this feature. […]
READ MORE