Pregunta de entrevista de Carousell

Implement debounce function using JS.

Respuesta de la entrevista

Anónimo

16 jun 2021

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