JSFiddle - React, Tailwind, and code Playground

by Abdul Ahmad

JavaScript

function doAsync() {
	return new Promise((res, rej) => {
  	setTimeout(() => res('hi'), 3000);
  });
}

doAsync().then(() => {
	console.log('async then 1');
	return doAsync();
}).then(() => {
	console.log('async then 2');
});