const loadAll = async function (imgArr) {
try {
let singleImage = imgArrItem => createImage(imgArrItem);
// creates 3 promises
const imgs = imgArr.map(singleImage);
console.log(imgs);
} catch (error) {
console.log('Images not loaded');
}
};
loadAll(['img/img-1.jpg', 'img/img-2.jpg', 'img/img-3.jpg']);