function debounce(fn, delay) {
let timer
return function() {
clearTimeout(timer)
timer = setTimeout(() => {
fn.apply(this, arguments)
}, delay)
}
}
在使用防抖函数
function init() {
....
}
debounce(init, 200);
6023

被折叠的 条评论
为什么被折叠?



