Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda