function weatherImageMaker(){
console.log(dataTimeDay+" before if");
if(dataTimeDay="//cdn.weatherapi.com/weather/64x64/night/"+dataIconCode+".png"){
let dataNightImageSrc;
dataNightImageSrc="images/icons/weather/64x64/night/"+dataIconCode+".png";
weatherImage.src=dataNightImageSrc;
weatherMenuContainer.style.backgroundImage="url(images/backgrounds/nightsky.jpg)";
}else{
let dataDayImageSrc;
dataDayImageSrc="images/icons/weather/64x64/day/"+dataIconCode+".png";
weatherImage.src=dataDayImageSrc;
weatherMenuContainer.style.backgroundImage="url(images/backgrounds/wp7399540.webp)";
};
console.log(dataTimeDay+" after if");
};
Before the if statement the console tells me that dataDayTime=//cdn.weatherapi.com/weather/64x64/day/122.png, but then the if statement passes even though the condition isnt met. Then when the function is completed dayTimeData=//cdn.weatherapi.com/weather/64x64/night/122.png