I would love to get the returned value of the fetch()
block and make use of it in another function, I tried declaring a variable outside the fetch
and assigning it in the block but that doesn't seem to give me the desired result rather it returns undefined.
fetch(apiEndpoint).then(response => {
return response.json()
}).then(jsonFile => {
return jsonFile
})