Closures
Last updated
What is Closures?
Function closures are one of the most powerful, yet most misunderstood, concepts of JavaScript that are actually really simple to understand. A closure refers to a function along with its lexical environment. It is essentially what allows us to return a function A, from another function B, that remembers the local variables defined in B, even after B exits. The idea of closures is employed in nearly every other JavaScript program, hence, it's paramount for a JavaScript developer to know it really well.
Free resources to learn Closures
More in stage 12: Strict Mode
Closures: common questions
Can I learn Closures in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Closures in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Closures tutorial for beginners?
It is lesson 90 of 124 in the free JavaScript roadmap, in stage 12, Strict Mode. If you are new to JavaScript, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.