Intermediate · 25 XP
Implement Debounce Function
Implement a `debounce(fn, delay)` function. The returned debounced function should delay invoking `fn` until after `delay` milliseconds have elapsed since the last time the debounced function was called.
Show Step-by-Step Hint
- • Store a timer variable in the outer closure.
- • Clear any existing timer on each invocation before calling setTimeout.
Type: Code Challenge
Runtime: JAVASCRIPT
JAVASCRIPT solutionCHALLENGE #3