A closure is a function that has access to its parent scope. Here's an example from W3Schools.
var add = (function () {
var counter = 0;
return function () {return counter += 1;}
})();
add();
add();
add();
The counter is initially set to 0 and add() function is assigned its return value. This way, the function call would iterate existing value by 1. The output of the third function call would be 3.