06 函数节流与函数防抖
函数节流
function throttle(func, delay) {
let lastCall = new Date()
return function(...args) {
const now = new Date()
if (now - lastCall < delay) {
return
}
lastCall = now
return func.apply(this, args)
}
}函数防抖
最后更新于