What exactly is a Closure? It is the combo of a function bundled together with references to its surrounding state (the lexical environment). Basically, it gives you access to an outer function's scope from an inner function. In a closure, an inner f...

Markdown supported · ⌘↵ to post
Ayesha Sahar
What I fail to understand is, even if the console is a closure of setTimeout, how does the value of j become 4 if the condition we set in the for loop is that j <=3?
Hrishikesh Tule
Web Developer
beautifully explained the topic. thank you