18 Scope & Closures questions from the JavaScript bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Sign up free to see every answer with its explanation and ask the AI tutor.
A.var declarations are moved to the top of their function scope and initialized to undefined
B.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
C.the region a let or const binding is visible in — the nearest enclosing curly-brace block
D.the span in which a let/const binding exists but throws if accessed before its declaration runs
Answer + AI explanation with a free account
2. Which term means: "a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned"?
Mid
A.Temporal dead zone
B.Closure
C.Lexical scoping
D.Block scope
Answer + AI explanation with a free account
3. Which statement is correct?
Mid
A.Closure — the region a let or const binding is visible in — the nearest enclosing curly-brace block
B.Closure — a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
C.Closure — an immediately invoked function expression used to create a private scope without leaking globals
D.Closure — var declarations are moved to the top of their function scope and initialized to undefined
Answer + AI explanation with a free account
4. What is Lexical scoping?
Mid
A.an immediately invoked function expression used to create a private scope without leaking globals
B.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
C.the region a let or const binding is visible in — the nearest enclosing curly-brace block
D.scope determined by where code is written in the source, not by where a function is called from
Answer + AI explanation with a free account
5. Which term means: "scope determined by where code is written in the source, not by where a function is called from"?
Mid
A.Lexical scoping
B.Block scope
C.var hoisting
D.Temporal dead zone
Answer + AI explanation with a free account
6. Which statement is correct?
Mid
A.Lexical scoping — the span in which a let/const binding exists but throws if accessed before its declaration runs
B.Lexical scoping — an immediately invoked function expression used to create a private scope without leaking globals
C.Lexical scoping — a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
D.Lexical scoping — scope determined by where code is written in the source, not by where a function is called from
Answer + AI explanation with a free account
7. What is var hoisting?
Junior
A.scope determined by where code is written in the source, not by where a function is called from
B.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
C.an immediately invoked function expression used to create a private scope without leaking globals
D.var declarations are moved to the top of their function scope and initialized to undefined
Answer + AI explanation with a free account
8. Which term means: "var declarations are moved to the top of their function scope and initialized to undefined"?
Junior
A.Temporal dead zone
B.IIFE
C.Block scope
D.var hoisting
Answer + AI explanation with a free account
9. Which statement is correct?
Junior
A.var hoisting — the span in which a let/const binding exists but throws if accessed before its declaration runs
B.var hoisting — a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
C.var hoisting — var declarations are moved to the top of their function scope and initialized to undefined
D.var hoisting — the region a let or const binding is visible in — the nearest enclosing curly-brace block
Answer + AI explanation with a free account
10. What is Temporal dead zone?
Mid
A.the region a let or const binding is visible in — the nearest enclosing curly-brace block
B.an immediately invoked function expression used to create a private scope without leaking globals
C.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
D.the span in which a let/const binding exists but throws if accessed before its declaration runs
Answer + AI explanation with a free account
11. Which term means: "the span in which a let/const binding exists but throws if accessed before its declaration runs"?
Mid
A.Temporal dead zone
B.var hoisting
C.Block scope
D.Closure
Answer + AI explanation with a free account
12. Which statement is correct?
Mid
A.Temporal dead zone — the span in which a let/const binding exists but throws if accessed before its declaration runs
B.Temporal dead zone — var declarations are moved to the top of their function scope and initialized to undefined
C.Temporal dead zone — the region a let or const binding is visible in — the nearest enclosing curly-brace block
D.Temporal dead zone — a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
Answer + AI explanation with a free account
13. What is Block scope?
Junior
A.the region a let or const binding is visible in — the nearest enclosing curly-brace block
B.a function together with references to its surrounding lexical scope, so it can use outer variables after the outer function has returned
C.var declarations are moved to the top of their function scope and initialized to undefined
D.the span in which a let/const binding exists but throws if accessed before its declaration runs
Answer + AI explanation with a free account
14. Which term means: "the region a let or const binding is visible in — the nearest enclosing curly-brace block"?
Junior
A.Block scope
B.var hoisting
C.Closure
D.Temporal dead zone
Answer + AI explanation with a free account
15. Which statement is correct?
Junior
A.Block scope — var declarations are moved to the top of their function scope and initialized to undefined
B.Block scope — the region a let or const binding is visible in — the nearest enclosing curly-brace block
C.Block scope — an immediately invoked function expression used to create a private scope without leaking globals
D.Block scope — scope determined by where code is written in the source, not by where a function is called from
Answer + AI explanation with a free account
16. What is IIFE?
Mid
A.an immediately invoked function expression used to create a private scope without leaking globals
B.scope determined by where code is written in the source, not by where a function is called from
C.var declarations are moved to the top of their function scope and initialized to undefined
D.the span in which a let/const binding exists but throws if accessed before its declaration runs
Answer + AI explanation with a free account
17. Which term means: "an immediately invoked function expression used to create a private scope without leaking globals"?
Mid
A.Temporal dead zone
B.IIFE
C.var hoisting
D.Lexical scoping
Answer + AI explanation with a free account
18. Which statement is correct?
Mid
A.IIFE — the span in which a let/const binding exists but throws if accessed before its declaration runs
B.IIFE — an immediately invoked function expression used to create a private scope without leaking globals
C.IIFE — scope determined by where code is written in the source, not by where a function is called from
D.IIFE — var declarations are moved to the top of their function scope and initialized to undefined
Answer + AI explanation with a free account
Free to start
Answers, AI explanations, and a free readiness check
Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take the free 2-minute readiness check for a scored result. One full AI mock interview, scored like a real panel, is free when you sign up.