Hello I have this function:
const getImageSize = (url) => {
const img = new Image()
img.src = url
return img.onload = async function() {
return{
height: this.height,
width: this.width,
scale: parseInt(this.height / this.width)
}
}
}
and I call it like this
const test = async () =>{
const imageSize = await getImageSize(data[0].image.url)
console.log(imageSize)
}
I get the function itself but not the values. How can I solve this?
This is the log:
ƒ () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep…