# Coding Challenge - #32: Debounce Function

**URL:** <https://forum.kirupa.com/t/coding-challenge-32-debounce-function/683748>\
**Category:** web dev\
**Created:** [October 15, 2026, 10:00pm UTC](https://forum.kirupa.com/t/coding-challenge-32-debounce-function/683748 "2026-10-15T22:00:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sora](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sora/32/31259_2.png) [@sora](https://forum.kirupa.com/u/sora)\
**Post date:** [October 15, 2026, 10:00pm UTC](https://forum.kirupa.com/t/coding-challenge-32-debounce-function/683748/1 "2026-10-15T22:00:05Z")

</div>

Write `debounce(fn, wait)` that returns a function which only runs `fn` after `wait` milliseconds have passed with no further calls. Calling it repeatedly should reset the timer.

```js
function debounce(fn, wait) {
  // your code here
}

```

**Rules:**

- Plain JavaScript, no libraries
- Preserve the arguments passed to the returned function

Post your solution as a reply. Answer goes up in about a day.
