JavaScript › Closures

What is closure in JavaScript?

technical
intermediate
Model Answer

A closure is a function that keeps access to variables from its outer lexical scope even after the outer function has finished.

Sign up to see the full answer

Free account includes AI feedback, hints, mastery tracking, and 2,000+ questions.

What you get with OfferLoop

AI Practice & Feedback

Submit your answer, get instant AI scoring and improvement tips.

Full Model Answers

Detailed model answers with hints and explanations for every question.

Mastery Tracking

Track which questions you can answer confidently vs need practice.

2,000+ Questions

Behavioral, technical, system design, HR — all topics covered.