Can someone explain to me how I can use forEach without an error message? I'm programming since 1 month so maybe it's a simple mistake.
------------------------------------------------------------------------------
let galleryImages1 = document.querySelector(".gallery-img");
let getLatestOpenedImg;
let windowWidth1 = window.innerWidth;
if (galleryImages1) {
galleryImages1.forEach(function (image) {
image.onclick = function () {
}
});
};