About this challenge
Debounce Function is a hard javascript quirks coding challenge. It explores a surprising corner of JavaScript's behavior — the kind of gotcha that causes real bugs. Write your solution in the editor above, run it against the test cases, and get instant feedback — free, in your browser, no sign-up.
Show a hint & approach (spoiler)
Hint: Keep a `timer` variable in a closure. Each call clears the previous timer and schedules a new setTimeout.
Approach: Debouncing coalesces rapid bursts of calls into one invocation after quiet time. Classic use cases: search-as-you-type, window resize handlers.
Keep practicing
Browse all coding challenges, or build intuition for the underlying concepts with the algorithm visualizers and the developer cheatsheets.