# Closure

An inner function that remembers the variables around it.

## What is **Closure** in JavaScript?

**Closure** — An inner function that remembers the variables around it.

```javascript
function createCounter() {
    let count = 0;
    return () => ++count;
}
```

Level: Journeyman · [More JavaScript terms at this level](https://www.ask-codey.com/glossary/subjects/javascript/journeyman)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/closure-javascript
