Skip to main content

Closure

Programming

A function bundled with references to its surrounding scope.

A closure is a function that captures variables from the lexical scope in which it was defined, retaining access to them even after that scope has finished executing. Closures are central to JavaScript patterns like callbacks, module privacy, and currying.

← Back to full glossary