Hi I'm trying to get JSON data from a JSON file. I got it on my JS code but i cant use it out of the callback function. I want to use the data anywhere in my code. I want to pass the data to a variable
My code for getting JSON data is :
async function load() {
let url = 'sorular.json';
let obj;
obj = await (await fetch(url)).json();
return obj
}
load().then(res=>{console.log(res)})