JSFiddle - React, Tailwind, and code Playground

by Slico

JavaScript

function failPromise() {
  return new Promise((resolve, reject) => {
    setTimeout(function() {
       reject("booo")
    }, 2000)
  })
}

async function main() {
  try{
  	const response = await failPromise();
    console.log("qwe", response)
  } catch(err){
    console.log("asd", err)

  }
}

async function superman(){
	await main();
  await maint();
}

superman()