// 设计一个防抖函数
function debounce (fn,delay) {
  let timer = null;
  return function() {
    clearTimeout(timer);
    timer = setTimeout(()=> {
      fn.apply(this,arguments);
    }, delay || 300)
}
}

 

相关文章:

  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-06-22
  • 2021-08-27
  • 2021-06-21
猜你喜欢
  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-12-01
相关资源
相似解决方案