Closure is nothing but the inner function having the access to variables and parameters of its outer function. Even after outer function has returned.
To understand closures better you should be familiar with the fundamental terms scope and lexical scope. Once you are familiar with scope and lexical scope you are one step ahead from closures.
scope is limiting the accessibility of variable and not having availability everywhere in the code. One of the major advantage of scope is some sort of security to the code, Scopes can be layered in a hierarchy in which child scopes have access to parent scopes.
Lexical scope has a set of rules for defining a variable in a program, when the program is compiled. These rules cannot be changed while the program is executing.
Javascript has a mechanism for scoping called lexical scoping.lexical scoping means the accessibility of variables and also the position of the variable inside the nested scopes.
As we learned closures have advantages and disadvantages, it is also important to understand when we should use them.
Conclusion
A closure is bundling of function together with reference to its surrounding state(lexical environment).In other words closure give access to outer scope of a function from an inner function.