/* 防抖 */
function debounce(fn, delay) {
let timer;
return function () {
clearTimeout(timer)
timer = setTimeout(() => {
fn.apply(null, arguments);
},delay)
}
}
function debounce(fn, delay) {
let timer;
return function () {
clearTimeout(timer)
timer = setTimeout(() => {
fn.apply(null, arguments);
},delay)
}
}
全部评论
相关推荐
查看18道真题和解析
点赞 评论 收藏
分享