← Quiz: Scope and Closures: all 10 questions
Quiz: Scope and Closures · Question 5 of 10
What is a closure?
What is a closure?
- A.An inner function that remembers variables from the enclosing function after that function has returned
- B.A function that closes open files automatically
- C.A function with no parameters
- D.A function that cannot be called twice
Answer & explanation
Correct answer: An inner function that remembers variables from the enclosing function after that function has returned
The remembered variables live in cells attached to the inner function.
Can you get the rest right without peeking?
Take the timed Quiz: Scope and Closures quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →