面试题,防抖与节流代码
对于防抖和节流的实现分别分享两中样式~~
// 防抖
// 01
function debounce1(func, delay) {
let timer
return function () {
clearInterval(timer)
timer = setTimeout(() => {
func()
}, delay)
}
}
// 02
function debounce2(func, d...
原创
2021-08-09 18:28:27 ·
177 阅读 ·
0 评论