Define Private field Members and Inheritance in JAVASCRIPT module pattern

No. Privateness in JavaScript can only be done by scoping (and exporting from them: closures). Those functions that need to access the private variables (and functions), called privileged methods need to be defined inside the constructor. Those methods that don’t (which only interact with public properties or other methods) should be defined on the prototype … Read more

JavaScript design pattern: difference between module pattern and revealing module pattern?

There are at least three different ways to implement the Module Pattern, but the Revealing Module Pattern is the only Module Pattern descendant that has an official name. The Basic Module Pattern The Module Pattern must satisfy the following: Private members live in the closure. Public members are exposed in the return object. But there’s … Read more