Closure in JavaScript
The closure is an important concept in functional programming. Closure means that an inner function always has access to the vars and lets of outer function, even after the function has returned. It is a form of lexical scoping. A closure is the combination of a function bundled together (enclosed) with references to its surrounding …