Both limit how often a function runs in response to rapid, repeated events — but with different timing strategies.
- Debounce: run the function only after activity stops for N ms. Resets the timer on every call. → "wait until they're done."
- Throttle: run the function at most once per N ms during continuous activity. → "run at a steady rate."
text
events: x x x x x x x ........ x x x
debounce: ↑ (fires once, after the pause)
throttle: ↑ ↑ ↑ ↑ (fires periodically)
