JSFiddle - React, Tailwind, and code Playground

by Sahin Deniz

JavaScript 1.7

function waitForNSeconds(seconds) {
  return new Promise(resolve => setTimeout(resolve, seconds * 1000));
}

// Consider this function is the one that I want to remove async/await from it
function waitForMe() {
  return waitForNSeconds(1);
}

(async () => {
  console.log("Print now and wait for a second");
  await waitForMe();
  console.log("Hey!");
})()