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

What distinguishes an ES module from a classic script?

Short interview answer

An ES module has its own top-level scope, uses static import/export syntax, runs in strict mode, and is evaluated once per module graph instance. Browser modules are deferred by default and participate in dependency graph loading.

Key takeaway

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

← Back to JavaScript modules

Related questions