When a function is defined inside another function and has access to the outer function’s variables, the inner function is known as a _________.

  • Nested Function
  • Inner Function
  • Callback Function
  • Closure
A closure is a JavaScript feature where a function has access to variables from its containing (enclosing) function's scope even after the outer function has finished executing. It's a powerful concept for maintaining data privacy and creating functions that remember and can access their outer scope.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *