Debouce com função clara de Debounce JavaScript

 const clearDebouncer = (name)=>{
     clearTimeout(global[name]);
     window[name] = undefined;
 }
 const debounceFunction = (func,timer, name)=>{
     clearDebouncer(name)
     window[name] = setTimeout(() => {
     func()
 }, timer);
 }
Husnain Syed