Top 10 use cases of JavaScript Closure
A closure in JavaScript is a function that has access to its outer scope variables even after the outer function has returned. Closures are created when a function is defined within another function, and the inner function has access to all the variables in the outer function's scope.