Cara membuat fungsi debounce lebih tinggi

const debounce = (fn, delay) => {
  let _timerId;

  return (...args) => {
    clearTimeout(_timerId);

    _timerId = setTimeout(() => {
      fn(...args);
    }, delay);
  };
};
Kasettado