Skip to main content

Javascript: the module pattern

The module pattern is defined by two things.

1-An outter wrapping function

2-An returned object containing at least one function

It was initially introduced a decade ago by Douglas Crockford in order to provide encapsulation, therefore exposing only what is needed, reducing the risk users would access, undocumented features.  

Comments