Spot the bug - #1

Find the bug before running it.

function debounce(fn, delay) {
  let timer;
  return function (...args) {
    clearTimeout(delay);
    timer = setTimeout(() => fn.apply(this, args), delay);
  };
}

Reply with what is broken and how you would fix it.

MechaPrime