Func | delay

PHOTO EMBED

Mon Apr 11 2022 14:18:14 GMT+0000 (Coordinated Universal Time)

Saved by @massa

const delay = (fn, wait, ...args) => setTimeout(fn, wait, ...args);

delay(
  function(text) {
    console.log(text);
  },
  1000,
  'later'
); // Logs 'later' after one second.
content_copyCOPY

Invokes the provided function after wait milliseconds. Use setTimeout() to delay execution of fn. Use the spread (...) operator to supply the function with an arbitrary number of arguments.

https://30secondsofknowledge.com/