const throttle = (fn, wait) => {
let throttled
return function(){
if(!throttled){
fn.apply(this, arguments)
throttled = true
setTimeout(()=>{
throttled = false
}, wait)
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: