JavaScript · Middle · Question 15 of 75

How does debounce differ from throttle?

Explanation

Debounce suits search-as-you-type: the request goes out when the user stops typing. Throttle suits scroll and resize: the handler runs regularly but at a limited rate. Both are implemented via a closure with a timer.

Further reading

Problem with a question

JavaScript · Middle · question 15

Test yourself

Take the JavaScript · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz