What is the real use of closures in javascript?
can you explain the concept with a simple example.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Jan 9, 2016, 1:52 AM EST
JavaScript variables can belong to the local or global scope.
Private variables can be made possible with closures.