Cannot read property '0' of undefined [Weather API]

Cannot read property '0' of undefined [Weather API]
0.0 0

#1

Hi,

I know that it’s a very basic thing and may seem stupid to ask, but I’m getting this error in my console. I’ve searched for similar errors or questions that people have already asked, read this API Pass-through and other forum posts/solutions but I can’t understand it. I don’t want that somebody would just send me the correct code to solve the thing, I really want to understand how to talk with the API. I don’t want to watch a tutorial and copy/paste the thing.

Here is the link of my project - [https://codepen.io/Dementor-/pen/bvpeVo?editors=1011]

Thank you for your time for reading this.


#2

So I understand 1 thing that after assigning long and lat values, I needed to assign API URL to the variable inside the function. In this way it can reach long and lat values :smiley:

Thanks anyway, hope this info helps someone.