I am calling a local json file using fetch and aync and await, but when I call this all I see in the console is the Promise pending and in it showing the state as fulfilled and not the json data.
The code is
$(document).ready(() => {
const jData = ReturnJSONData();
console.log(jData);
});
async function ReturnJSONData() {
const data = await fetch("../TreeListData.json");
const ds = await data.json();
return ds;
}
In the async function the returning ds has the json in it