Saisie de Code · JavaScript
Debounce
Delay invocation until activity stops for a given wait period.
Difficulte: Intermediaire · 13 Lignes · Licence: public-domain
function debounce(fn, wait) {
let timer = null;
return function debounced(...args) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
fn.apply(this, args);
timer = null;
}, wait);
};
Temps0:00
Vitesse (WPM)0.0
Précision100.0%
Erreurs0
Clavier Live
Touche Suivante: F | Dernière Touche: -
Progression: 0.0%
@
&
É
"
'
(
§
È
!
Ç
À
)
-
A
Z
E
R
T
Y
U
I
O
P
^
$
Q
S
D
F
G
H
J
K
L
M
Ù
W
X
C
V
B
N
,
;
:
=
Espace
Timed Test Leaderboard
Aucun resultat pour le moment.