Closure Concept Check
Concept Check Medium
Question
What is a closure in JavaScript?
Hint
Closures are about remembering the surrounding scope.
Explanation
A closure is a function that 'closes over' (remembers) the variables from its lexical scope, even after the outer function that created it has returned. This allows data to be 'remembered' privately. Closures are the foundation of modules, partial application, and many functional programming patterns in JavaScript.
Related Resources
Related Lessons
- JavaScript Functions
Learn about closures.
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.