Frage im Vorstellungsgespräch bei Carousell

Implement debounce function using JS.

Antwort im Vorstellungsgespräch

Anonym

16. Juni 2021

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