Question d’entretien chez Carousell

Implement debounce function using JS.

Réponse à la question d'entretien

Utilisateur anonyme

16 juin 2021

function debounce(func, wait) { let timeout return function(...args) { const context = this clearTimeout(timeout) timeout = setTimeout(() => func.apply(context, args), wait) } }