What is the significance of a returned inner function having access to the outer function's variables even after the outer function has executed?

  • It's a programming error and should be avoided.
  • It has no significance; it's just a quirk of JavaScript.
  • It allows data encapsulation and creates private variables, aiding in maintaining state and data privacy.
  • It has no practical use in JavaScript.
The significance of a returned inner function having access to the outer function's variables after the outer function has executed is that it enables data encapsulation and the creation of private variables. This is crucial for maintaining state and data privacy in JavaScript applications.
Add your answer
Loading...

Leave a comment

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