Hello people, this is the first time I create around here.
I have been working on the local weather app project, I have come to a dead end sadly (for my skills), everything seems to be sending properly, or not, I don’t really know, also I think that there is a small error in the forEach loop, but I can’t seem to identify it, all help would be appreciated
Link: https://codepen.io/dereckfrost9/pen/zwbxYq?editors=1111
Hi Dereck,
Your code has many errors, let’s see!
Line 36: console.log(json);
=> This is causing error because the variable json
does not exist.
Line 7 and 9: position.coord.latitude +
and position.coord.longitude
=> This is causing error because the correct property is coords
and not coord
.
Line 21: weather.forEach
=> This is causing error because the weather
parameter of the callback function
is an object
and not an array
. Use console.log
in the parameter to see the properties.
I took the liberty of making some adjustments to show you how it will look.
Fork Link: https://codepen.io/devgaspa/pen/EmBVKE
I hope helped
Thank you for your help, I was able to get it running now