let timeout;
const debounce = (callback, wait) => {
return (...args) => {
clearTimeout(timeout);
timeout = setTimeout(function () {
callback.apply(this, args);
}, wait);
};
};
const exampleFn = () => {
console.log('Hello Word')
};
debounce(exampleFn, 1000);