JSFiddle - React, Tailwind, and code Playground
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})
})