getPhotoStatus();
async function getPhotoStatus () {
let res = await fetchPhoto('/photos/19062657811.png');
console.log(res);
}
async function fetchPhoto(uri) {
const status = fetch(uri).then(response => response.status);
return status;
}
I have this code here, it works fine but removing getPhotoStatus() and awaiting the fetch function directly in fetchPhoto() returns a Promise, is there another way to do this instead of making double functions basically to get the value of a Promise directly from the outer scope?