sorry, can someone show me the code and explain me, how to I can load only once the json file, and use all the content file OUTSIDE the function?
let jsonCompleto
fetch('uno.json')
.then(function (response) {
return response.json();
})
.then(function (data) {
todo = data.length
console.log(todo)
jsonCompleto = data
console.log(jsonCompleto) // this return all the json file correctly
})
console.log(jsonCompleto) // this return undefined
// how can load only once the json file and use all content of json file OUTSIDE the function ?