Skip to content
JavaScript·Beginner·Conceptual·1 min read

What is the module pattern?

Short interview answer

An immediately invoked function or factory keeps implementation bindings private and returns a public object of closures. ES modules now provide clearer file-level encapsulation for many uses.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Closures

Related questions