Answers for "fetchData from json file"

0

fetchData from json file

const fetchData = async () => {
  try {
    const res = await fetch("js/data.json");
    data = await res.json();
    displayData(data);
  } catch (e) {
    console.log("something went wrong!", e);
  }
};

fetchData();
Posted by: Guest on January-03-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language