JSFiddle - React, Tailwind, and code Playground

by Kristian Jabilles

JavaScript

async function series() {
  await wait(500, 'first'); // Wait 500ms…
  await wait(500, 'second'); // …then wait another 500ms.
  return "done!";
}

function wait(time, message) {
	setTimeout(() => {
  	console.log(message)
  }, time);
}