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.
Loading...
Related Quiz
- You're developing a Node.js application and notice that the "this" keyword inside a regular function, defined in the global scope, refers to something different than you're used to in client-side JavaScript. What does "this" refer to in this context?
- Which data type is NOT available in JavaScript?
- How can you prevent script injection attacks when dynamically modifying element content with user input?
- How can you add a method to an object in JavaScript?
- What does the prototype property of a function allow you to do?