i wanted to work with fetched data out of its scope or assign the result into a variable but i cant always send a promise which its state is fullfiled and have result in it
let fetchData = fetch("/some api /")
.then(resposne => resposne.json())
.then(data => data)
console.log(fetchData)
the fetchData always is a promise witch with status of fullfiled how to i can use and work with data inside of last .then scope but not outside i tried to make a variable outside of it
let someData;
let fetchData = fetch("/some api /")
.then(resposne => resposne.json())
.then(data => {
someData = data
})
console.log(someData)
but its undefined my question is how to work with fetched data and use it every where