Debounce VS Throttle: What's The Difference? Which One To Use?
First, let's go over what they have in common. Both debounce and throttle act as flood gates between events and event handlers. They're useful when you want to execute an expensive operation, such as a DOM query or an API request, based on a mostly continuous trigger such as mousemove or scroll.
We'll go over how each one of them works, and then explore a common use case for when you should use one over the other.