Closure Concept
Multiple Choice Medium
Question
What does a closure capture from its outer scope?
Hint
Closures capture by reference, not by value.
Explanation
A closure captures the variables it actually references from its enclosing scope, by reference not by value. This means the inner function can access and modify those variables even after the outer function has returned. Closures are the foundation of data privacy and function factories in JavaScript.
Related Resources
Related Lessons
- Scope and Visibility
Learn about scope.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.