JSFiddle - React, Tailwind, and code Playground

by Kabir Hossain

JavaScript

function test() {
	return new Promise( (resolve, reject) => {
  
  	if( Math.round( Math.random() ) ) {
    	resolve("okay")
    } {
    	reject("Not Okay")
    }
  })
}

( async () => {
	const dt = await test();
  
  console.log({dt})
})