Programming Hard

JavaScript: Closures & Scope

Closures are one of JavaScript's most powerful — and most misunderstood — features. This quiz tests whether you can predict what code actually does, not just recite the definition.

Questions cover lexical scope, the difference between function and block scope, hoisting, the Temporal Dead Zone, and classic closure gotchas like the loop-variable problem — including code snippets where you need to trace through the output.

If var vs. let inside a loop has ever surprised you, this quiz will test whether you actually know why.

Start quiz → Opens in a new tab on Cletica
Sample questions3 of 13 shown
Q1
What is a closure in JavaScript?
Q2
What will be logged to the console?
Q3
Which of the following correctly demonstrate closure? (Select all that apply)
Answer all 13 questions on Cletica →

What This Quiz Covers

Cletica

Want to create your own quiz?

Build surveys and quizzes, share with anyone, collect responses — free to start.

Try Cletica for free →