Javascript Module Pattern


/ Published in: JavaScript
Save to your folder(s)

The module pattern was originally defined as a way to provide both private and public encapsulation for classes in conventional software engineering.
In JavaScript, the module pattern is used to further emulate the concept of classes in such a way that we're able to include both public/private methods and variables inside a single object, thus shielding particular parts from the global scope. What this results in is a reduction in the likelihood of your function names conflicting with other functions defined in additional scripts on the page.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.