DEV Community

Chad Gauthier
Chad Gauthier

Posted on

I would tell you a joke about async javascript

const tellJoke = async () => {
  console.log("I would tell you a joke about async JavaScript...");
  try {
    const punchline = await getPunchline();
    console.log(punchline, '🥁 Ba-dum-da-cha!');
  } catch {
    console.log('Joke delivery failed: Maximum call stack size exceeded!');
  }
};

async function getPunchline() {
  console.log(await getPunchline()); // practice for good delivery
  return "But I'm still awaiting for the punchline.";
}

tellJoke();
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →