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

Why are WeakMap entries not enumerable?

Short interview answer

Enumeration would expose whether garbage collection has occurred, making nondeterministic collection timing observable and preventing important implementation freedom.

Key takeaway

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

← Back to Memory management

Related questions