JavaScript

Closure

Definition

A function that retains access to variables from its outer (enclosing) scope even after the outer function has returned. Closures are created every time a function is created in JavaScript.

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Learn More

Related Terms