CS Fundamentals Trainer · JavaScript · Performance & Memory
In a single-page app, which of these commonly cause memory to grow each time a view is opened and closed?
- A `resize` listener added to `window` when the view mounts and never removed
- A large array created in a function that has returned and isn't referenced anywhere
- A `setInterval` started by the view and never cleared
- A module-level `Map` that caches API responses by URL with no eviction
- Removed DOM nodes still referenced from a JavaScript array
Difficulty: easy