One function written inside another function is called a nested function. Suppose that there are two functions outer function and inside it there is an inner function. The inner function will have access to its own variables, the outer functions variables, arguments and it has access to global variables. This is done by a scope chain. Every function so created has a scope chain associated with which helps us in accessing the variables value.
Now what are closures? Closures - the nested functions continue to live even when the outer function has completed is closure. The day to day way in which we are able to see closure is callbacks. Callbacks are functions which are usually executed when an event completes, when they are executed they have access to outer functions variables even though the outer function has completed its execution.