JSFiddle - React, Tailwind, and code Playground

by Gustavo

JavaScript

function after5s(x) {
	return new Promise(res => {
  	setTimeout(() => {
    	res(x);
    }, 5000)
  });
}

async function run() {
	const f = after5s(3);
  const a = after5s(4);
	console.log(await f + await a);
}

run();