Which of the following is NOT a characteristic of closures in JavaScript?

  • Data encapsulation and privacy
  • Persistence of local variables
  • Ability to access outer variables
  • Limited use of memory resources
Closures in JavaScript are powerful because they allow functions to remember and access their outer (enclosing) variables even after the outer function has finished executing. This feature can lead to memory usage if not managed properly, but it's not a limitation or disadvantage of closures per se.
Add your answer
Loading...

Leave a comment

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