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

What's a lazy singleton, and why might it be preferred over an eagerly created one?

Short interview answer

It defers creating the singleton instance until the first time it's actually requested, rather than at module load — useful when the instance is expensive to construct and might never be needed in a given execution path.

Key takeaway

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

← Back to JavaScript design patterns

Related questions