let img = new Image();
img.onload = function() {
var img_height = this.height;
console.log('img onload', img_height);
};
setTimeout(function(){
console.log('without unload', img_height);
}, 100);
Подскажите плиз, как передать img_height в консольку таймаута?
в функции return img_height(используй camelCase)
создай переменную, вызови эту функцию и потом передай в таймаут