I am working on my local weather app but I am getting undefined when trying to access the weather type from the fcc api. Seems that the api isn’t working correctly.
Could someone figure it out for me, please or should I use another api?
Hey. The weather property is an array:
so you’ll need to access it through its index, like:
let weatherType = data.weather.main;
let weather = data.weather.description;
Also as a tip, if you’re using Chrome (don’t know about the other browsers), you can just hover on the object properties in your console and a popup will show you how to access them:
Oo thanks, I just saw it…
And thank you also for the tip…