JSFiddle - React, Tailwind, and code Playground

by Farzad YZ

JavaScript

async function asyncLoad() {
  const random = Math.random();
  if (random > 0.5) return true;
  else throw (false)
}

Promise.race([asyncLoad(), asyncLoad(), asyncLoad()]).then(console.log).catch(console.error)