On Thu, Feb 17, 2011 at 9:11 PM, Jason Mulligan <
[email protected]> wrote:

> Why is that called a "Module Pattern"? It's just closure?
>

No, that's the "revealing pattern". It's the module pattern because all the
variables, functions and constructors he defines are in a new own scope,
which makes the odds of collisions diminish (and has the upshot of
increasing security). The name makes more sense if you have more of them in
the same program.

The revealing pattern, by the way, is an object that creates a new function
in the constructor and returns a new (but different from `this`) object that
exposes only the public methods.

- peter

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to