Domanda di colloquio di Carousell

Implement debounce function using JS.

Risposta di colloquio

Anonimo

16 giu 2021

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