Skip to main content

JavaScript Closures

A closure is a combination of a function bundled together with reference to its surroundings.

In other words, a closure gives you access to an outer function's scope from an inner function.

Closures remember the outer function scope ever after creation time.