JSFiddle - React, Tailwind, and code Playground

by msfrisbie

HTML

async function foo() { return 3; } async function bar() { throw 4; } foo().then(console.log) bar().catch(console.log)

JavaScript

(async function() {
  console.log(await new Promise((resolve, reject) => setTimeout(() => resolve(3), 1000)));
})();