JSFiddle - React, Tailwind, and code Playground

by Richard Ayotte

JavaScript

async function throwingPromise() {
  throw new Error('Hello!')
}

console.log('here')

async function main() {
  try {
    throwingPromise()
  } catch (error) {
    console.log('error caught!')
  }
}

main()