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

How do lexical and variable environments differ?

Short interview answer

They are specification components used for different declaration and scope behavior. Modern explanations should avoid assuming two permanent plain objects with every variable copied into them.

Key takeaway

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

← Back to Execution context

Related questions