function throttle(fn, delay) {
let timer = null;
return function() {
if(timer) return;
timer = setTimerout(()=>{
fn.apply(this,arguments);
timer = null;
},delay)
}
}
function throttle(fn, delay) {
let timer = null;
return function() {
if(timer) return;
timer = setTimerout(()=>{
fn.apply(this,arguments);
timer = null;
},delay)
}
}