Estoy confundido acerca de cómo se pasa el evento de puntero a debounce() en addEventListener(). Para la variable constante multiply toma los dos argumentos que se pasan como argumentos en args debounce() . Sin embargo, cuando se usa en .addEventListener() , solo veo la sintaxis que define la función. Entonces, ¿cómo se pasa el evento del puntero como argumento como en el primer ejemplo?
function debounce(func, timeout = 1000) { let timer; return (...args) => { if (timer) clearTimeout(timer); timer = setTimeout(() => { func(...args); }, timeout); }; } const multiply = debounce((x, y) => console.log(x * y)); multiply(10, 10); //I see that this takes the arguments that assign to x and y button.addEventListener( "click", debounce((e) => console.log("clicked"))); //but here I am confused how the pointer event is being passed as an argument