Icons not working - Local Weather app

Icons not working - Local Weather app
0

#1

Hello there, everybody.

I can’t figure out why the images for the weather conditions won’t appear. Any hints would be greatly appreciated. :slight_smile:

Here’s the project link:
https://codepen.io/Milos2709/pen/WxmdaA?editors=0010


#2

First off, you might want to double check if you’re accessing your condition correctly. (It’s inside an array :slight_smile:)

Secondly, there’s a console error regarding your switch statement, it’s saying condition is undefined. This is because the variable condition is in a different scope than your switch statement. Try putting the switch statement in the same scope as the variable condition and it should work!

(I’m getting a nice big sun after I’ve done these changes :smiley:)


#3

Thanks a lot @thelittleblacksmith, I managed to fix it with your instructions. Cheers!