2026前端面试题(六)
防抖const debounce (fn,delay300) >{let timer nullreturn function(...args){clearTimeout(timer)timer setTimeout(()>fn.apply(this.args),delay)}
}节流const throttle (fn,delay300)>{let lock falsereturn function(...args){if(!lock){lock truesetTime…
2026/8/14 15:28:55