ff7a87b0-c5e3-439b-bf81-c01754c44877
prompter
Crear una función debounce en JavaScript
049b94d9-602a-41b7-8e2f-6f114e84a350
ff7a87b0-c5e3-439b-bf81-c01754c44877
assistant
function debounce(fn, delay) {
  let timer;
  return function() {
    clearTimeout(timer);
    timer = setTimeout(() => fn.apply(this, arguments), delay);
  };
}