Debounce and throttle?
If someone asked me to make this, how would I do it?
HTML
<button id="debounceClick">
Debounce click
</button>
JavaScript
(function() {
var debounceButton = document.getElementById('debounceClick');
debounceButton.addEventListener('click',function() {
setTimeout(function(e) {
functionToDebounce();
}, interval)))
// function should make it so that the function that is passed does not // actually run until the interval specified has passed and
// subsequent calls will simply reset the timer
})()