function debounce(fn, delay) {
  let timer;
  return (...arg) => {
    const that = this;
    const args = arg;
    clearTimeout(timer);
    timer = setTimeout(() => {
      // 绑定this，传入参数给callback。通常我们需要事件对象就ok
      fn.apply(that, args);
    }, delay);
  };
}
/**
 * @desc debounce fn
 * @param fn function
 * @param delay Delay in milliseconds
 */
@desc debounce fn
@param fn function
@param delay Delay in milliseconds
@desc debounce fn @param fn function @param delay Delay in milliseconds
function debounce(fn, delay) {
  let timer;
  return (...arg) => {
    const that = this;
    const args = arg;
    clearTimeout(timer);
    timer = setTimeout(() => {
      fn.apply(that, args);
    }, delay);
  };
}
function debounce ( fn , delay ) { let timer ; return ( ... arg ) => { const that = this ; const args = arg ; clearTimeout ( timer ) ; timer = setTimeout ( ( ) => { fn . apply ( that , args ) ; } , delay ) ; } ; }
@desc debounce fn
 @param fn function
 @param delay Delay in milliseconds
@desc debounce fn @param fn function @param delay Delay in milliseconds
// 绑定this，传入参数给callback。通常我们需要事件对象就ok