JSFiddle - React, Tailwind, and code Playground

by Ravindra Athreya

JavaScript

async function f() {

  try {
    let response = await fetch('');
    let user = await response.json();
  } catch(err) {
    // catches errors both in fetch and response.json
    alert(err);
  }
}

f();