Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
dataTimeDay keeps changing once if statement runs
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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!