Performance Optimization in JavaScript

Assess techniques to improve JS app speed and efficiency.

1. Which technique limits the rate at which a function is called by ensuring it runs only once after a certain period of inactivity?
2. What does 'code splitting' in JavaScript primarily aim to optimize?
3. Which DOM operation is most likely to cause a reflow (layout thrashing)?
4. Event delegation leverages which event behavior to improve performance?
5. Memoization optimizes function performance by:
6. Which loop is generally most efficient for iterating over a large array in JavaScript?
7. What attribute should be added to a script tag to load it asynchronously without blocking HTML parsing?
8. Why are global variables detrimental to performance?
9. Which of the following are common causes of memory leaks in JavaScript? (Select all that apply)
10. Which practices help minimize reflows (layout thrashing) and repaints? (Select all that apply)
11. Which resources are commonly lazy loaded to improve initial page performance? (Select all that apply)
12. Which DOM query methods are most efficient for performance? (Select all that apply)
13. In which scenarios is memoization most effective? (Select all that apply)
14. Using 'let' instead of 'var' improves JavaScript performance by reducing memory usage.
15. Event delegation can reduce the number of event listeners attached to the DOM, improving performance.
16. Minifying JavaScript code improves runtime performance by making the code execute faster.
17. Using 'requestIdleCallback' allows non-critical work to be executed during browser idle periods, improving responsiveness.
18. What is the process of automatically freeing up memory by removing unused objects that are no longer referenced? (two words)
19. Name the technique that delays the loading of non-critical resources (e.g., images) until they enter the viewport (two words)
20. What is the name of the JavaScript API that allows running scripts in background threads to avoid blocking the main thread (plural noun)
Answered 0 of 0 — 0 correct