function debounce(fn, ms) {
let timerId;
return function(...args) {
clearTimeout(timerId);
timerId = setTimeout(function() {
fn(args);
}, ms);
};
}
let stack = debounce(s => console.log('Привет!',s), 1000);
stack('Андрей');
 
Code will run automatically after changes.
Code runs in an isolated environment.