From f0b298f7123a1f72055f05b958c05d28f77f3c8c Mon Sep 17 00:00:00 2001 From: DurgaPrasadpmdp <91715968+DurgaPrasadpmdp@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:44:25 +0530 Subject: [PATCH] Update implement-basic-debounce_en.md --- problem/implement-basic-debounce_en.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/problem/implement-basic-debounce_en.md b/problem/implement-basic-debounce_en.md index a74ae43d..8f09899e 100644 --- a/problem/implement-basic-debounce_en.md +++ b/problem/implement-basic-debounce_en.md @@ -1,4 +1,18 @@ -There is no solution yet. +function debounce(func, wait) { + // your code here + + let timer + return function(...args){ + clearTimeout(timer) + timer = setTimeout(()=>{ + func.apply(this,args) + },wait) + + } +} Would you like to [contribute to the solution](https://github.com/BFEdev/BFE.dev-solutions/blob/main/problem/implement-basic-debounce_en.md)? [Contribute guideline](https://github.com/BFEdev/BFE.dev-solutions#how-to-contribute) + + +