The JavaScript Module Pattern

Published: July 4, 2012
Excerpt: “However, people using this library are able to do jspy.count = 5 to manually adjust the value. Lets say for the purpose of this tutorial, that users should not be able to do that. In other languages you’d be able to define a private variable, but JavaScript doesn’t explcitly have them. However, we are able to manipulate JavaScript to provide them to us, and that brings us on nicely to one of the most popular JavaScript design patterns, the Module or Modular pattern.”

Tagged with:
Posted in Javascript