1. What is a closure in JavaScript?
- A function with no name
- A function bundled with its lexical scope
- A block scope variable
- A callback function
Reveal sample answer and explanation
Answer: A function bundled with its lexical scope
Closures allow functions to access variables from their lexical scope.