Glossary term
What is closure? Meaning for developers
A function bundled with the lexical environment it was written in. It keeps that environment alive even after the outer function has returned.
Learn it properly · JavaScript CoreLesson 10: ClosuresA function that remembers where it was born — even after the place it was born in is gone. This is the one exception to "popped execution context = memory freed" that Lesson 2 promised we'd come back to.