I am making a function that checks is there an image in url and it should return true or false depending of success.
var image = this.checkImage(imageUrl);
console.log('image: ' + image);
async checkImage(image){
var a;
await RNFetchBlob.fetch('GET', image)
.then((res) => {
a = true;
})
.catch((errorMessage, statusCode) => {
a = false;
})
console.log(a);
return a;
}
console.log(a);
returns true or false so that works allright, but console.log('image: ' + image);
returns [object Object]
Can you figure out what is wrong in my code?