noun
closure
a programming function that retains access to variables from the environment where it was created
The closure keeps access to the variable created in its outer function.
Etymology
Latin claudere supplies the idea of closing. In programming, a closure closes a function over its surrounding environment, retaining the variable bindings needed when the function is later used.
More examples
- We returned a closure from the factory function.
- Two closures shared the same captured value.
- The example showed how a closure preserved state.
Forms
closure · closures