useMemo Purpose
Multiple Choice Medium
Question
What is the primary purpose of useMemo?
Hint
useMemo trades memory for speed by caching results.
Explanation
useMemo caches (memoizes) a computed value, recomputing it only when its dependencies change. This avoids expensive recalculations on every render. It's also used to preserve referential equality of objects/arrays passed to memoized children.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.