Skip to content
<devsocial/>
NewsLearnBooksForumsCommunitiesConferences
  • Videos
  • Articles
  • Blogs
  • Chapters
  • Careers
  • Fuel
  • Hire AI talent
  • Events
  • Interviews
  • Stories
  • Companies
  • Newsletter
  • Get the app
LiveVideosArticlesBlogsChaptersCareersFuelHire AI talentEventsInterviewsStoriesCompaniesNewsletterGet the app
Sign inJoin free
Loading
<devsocial/>

Formerly C# Corner. A community of 3.1M developers learning, building and earning together.

Company

About UsPartnersBrand GuidelinesContact UsHackIndia (opens in a new tab)

Community

DevSocial LiveChaptersCommunitiesConferencesMembersMVPsMember Stories

Resources

LearnCareersHire DevelopersRewardsNewsletterIdeasHelp center

Legal

Privacy PolicyTermsReport a BugSitemap
© 2026 DevSocial. All contents are copyright of their authors.DevSocial is a community of AI-native builders.

MC 0.600 · 26 Nov 2026, 17:02 EST

  1. Home
  2. Interviews
  3. JavaScript
  4. What is closure in JavaScript and example? What is use of closure?

Interviews1 answer

1
Answer

What is closure in JavaScript and example? What is use of closure?

Ganesan C

Ganesan C

5yPosted Aug 12, 2021, 7:36 AM EDTJavaScript

1 Answer

Join to answer this question

Every answer you publish earns 10 SHARP.

Create free accountSign in
Md Sarfaraj

Hello Ganesan,
Please check the below URLs it will help you:
https://www.w3schools.com/js/js_function_closures.asp
https://www.tutorialsteacher.com/javascript/closure-in-javascript
https://medium.com/javascript-scene/master-the-javascript-interview-what-is-a-closure-b2f0d2152b36

Md Sarfaraj5yPosted Aug 17, 2021, 12:10 AM EDT
JavaScript · answered

More questions

  1. 1How does async/await work under the hood?
  2. 2What is the difference between ECMA Script and Javascript?
  3. 1What is different between normal function and arrow function in javascript?
  4. 2What are the data types in javascript ?
  5. 1Discuss the differences between for...of and for...in when iterating over objects.
  6. 1What is the difference between = , == and === in javascript?
All JavaScript questions →
Interviews · most answers, last 30 days

Top answerers

01Kamlesh Kumar9answers02Rinki1answer
?YouYour name goes here.Answer a question and you are on it.Join
Full leaderboard →
2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegisterMembers onlyDevSocial PressAI native · 02The Builders SeriesClaude for AI-Native BuildersA beginner's guide for creators and innovators.Mahesh Chand171 pages · BeginnerFeatured eBookClaude for AI-Native Builders171 pages · Members download free.Download now
Know the answer?

Answer an interview question and earn +10 SHARP for every answer.

See unanswered questions