JSFiddle - React, Tailwind, and code Playground

by joplomacedo

JavaScript

const p1 = new Promise( (res) => {
	setTimeout( () => res(), 1000)
})

const p2 = new Promise( (res) => {
	setTimeout( () => res(), 2000)
})

Promise.all([p1,p2]).then( () => alert('done'))