ms
milliseconds.setTimeout()
to delay execution of fn
....
) operator to supply the function with an arbitrary number of arguments.const delay = (fn, ms, ...args) => setTimeout(fn, ms, ...args);
delay( function(text) { console.log(text); }, 1000, 'later' ); // Logs 'later' after one second.
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️