DEV Community

Cover image for Closure in JavaScript
Md. Al Amin
Md. Al Amin

Posted on

Closure in JavaScript

In JavaScript, a closure is a function that references variables in the outer scope from its inner scope.

In JavaScript, a function can also contain another function. This is called a nested function.

In JavaScript, closure provides access to the outer scope of a function from inside the inner function, even after the outer function has closed.

Top comments (0)