Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

131
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda