javascript
intermediate
محلول
ينتهي في 2026-11-17
Debounce from scratch
Implement debounce(fn, wait) without any library. The returned function:
- delays calling
fnuntilwaitms 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.
حلّه 0 شخصًا حتى الآن.
المحررCtrl + Enter
عندما تطبع الاختبارات "All tests passed" يُعلَّم التحدي كمحلول في هذا المتصفح.
إرسال حلك للمراجعة