Javascript quiz Intermediate Javascript 1. What is the most common real-world issue caused by using `var` instead of `let` in loops? Slower execution Memory leaks Unexpected shared values due to function scoping Syntax errors 2. Why does `setTimeout(fn, 0)` not execute immediately? JavaScript pauses execution It waits for DOM rendering The callback is queued after the call stack clears The browser throttles timers 3. Which combination is required to establish criminal liability? When performance is critical When parallel execution is needed When error handling is required When Promises are unavailable 4. What is a common cause of race conditions in frontend applications? Slow network Multiple unresolved async calls updating shared state Too many components CSS reflows 5. Which Promise method should you use when you need results even if some fail? `Promise.all` `Promise.race` `Promise.any` `Promise.allSettled` 6. Which use case best fits debouncing? Infinite scrolling Window resize handling Mouse movement tracking API rate limiting 7. What is the modern way to cancel a fetch request? Clearing the Promise Using `clearTimeout` `AbortController` Returning early 8. What causes layout thrashing? Too many CSS files Repeated read/write DOM operations Large images Nested components 9. Why is event delegation effective? It improves accessibility It reduces memory usage and improves performance It simplifies CSS It prevents bubbling 10. What directly reduces JavaScript bundle size? Minification Tree shaking Caching Lazy loading Submit Answers