Debounce & Throttle Functions

In this basic debounce implementation, what is the purpose of the clearTimeout call before setting a new timeout?
function debounce(func, wait) {
  let timeout;
  
  return function executedFunction(...args) {
    const later = () => {
      clearTimeout(timeout);
      func(...args);
    };
    
    clearTimeout(timeout);
    timeout = setTimeout(later, wait);
  };
}
Next Question (2/20)