javascript intermediate Termina el 2026-11-17

Debounce from scratch

Implement debounce(fn, wait) without any library. The returned function:

  • delays calling fn until wait ms have passed since the last call,
  • passes the latest arguments to fn,
  • has a .cancel() method that drops a pending call.

The tests use real timers; run the code and wait a moment for All tests passed.

Resuelto por 0 personas hasta ahora.

javascript
EditorCtrl + Enter

            
        

Cuando las pruebas muestran "All tests passed", el reto se marca como resuelto en este navegador.

Envía tu solución para revisión