Skip to content

Glossary: JavaScript Beyond the Basics

Closure

Also written: closures

A function together with the variables from the scope where it was written, which it keeps access to even after the outer function has finished. Each call to `makeCounter` makes its own private `count`.

Where the book teaches it

Related terms

ScopeFactory function