Search posts, tags, users, and pages
Mansoor Ameen
Self-taught coder | Front-end developer
What is Closure ?? Heard someone saying "this piece of code is possible because of closure" ?! Most probably you encountered this word somewhere in your coding journey.One of the core concepts that every JS developer should know. Well, what is cl...
Paarth Bajaj
Now if you combine all those functions (not one, but all) with each of their lexical environment, that is called Closure! Explain this in the code please.
Paarth Bajaj Functions form closures. Here each function forms a closure, and that's why they can access var num.
Thank you for answering my stupid doubts! Mansoor Ameen
Paarth Bajaj Glad to be of some help :)
Paarth Bajaj
Now if you combine all those functions (not one, but all) with each of their lexical environment, that is called Closure! Explain this in the code please.