JavaScript·Advanced·Conceptual·1 min read
Where does requestAnimationFrame run?
Short interview answer
The browser invokes animation-frame callbacks before a rendering opportunity when the document is eligible. The callback still runs on the main thread and can delay the frame if expensive.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.