JavaScript常见问题(一)

防抖和节流的区别及实现防抖触发高频事件后 n 秒内函数只会执行一次,如果 n 秒内高频事件再次被触发,则重新计算时间。function debounce(fn, timing) { let timer; return function() { clearTimeout(timer);
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×