If you see the code mentioned in this post on the top, that itself is a closure(the function b has access to var num that is outside the function b, which is also its lexical environment). What I meant by "combine all those functions (not one, but all)" is that, if you had many nested functions here like:
function a() {
var num = 10;
function b() {
var newNum = num + 5;
console.log(newNum)
function c() {
console.log(num)
function d() {
console.log(num)
}
}
}
}
each of these functions has its own lexical environment, right? And this whole code is called closure[ combine all the lexical environments, you get a closure]. As it is closure, all these functions will have access to var num, and also any variables declared in the global scope.
I think that last line in my post is confusing. Will update it.