Utilizing closures with caution is essential as they can lead to potential memory leaks due to retained ________.
- Variables
- Functions
- References
- Objects
Closures retain references to their containing scope, which includes variables and functions. If not managed carefully, this can lead to memory leaks as these references may prevent objects from being garbage collected.
Loading...
Related Quiz
- How can you use the fs module to copy a file from one location to another?
- The spread operator can effectively be used to create a shallow ______ of an object or an array.
- To avoid blocking the Event Loop with CPU-bound tasks, developers can offload such tasks to ________.
- You are creating a build for a production environment and realize that some of the devDependencies are being included in the build, causing it to be bulkier. What steps would you take to rectify this?
- What happens when you try to access an index in a buffer that does not exist in Node.js?