Quick question on my weather project

Quick question on my weather project
0.0 0

#1

Project Link - http://codepen.io/codejsp/pen/YNxBmg
for

var weatherType = data.weather[0].description;

Why do i need that [0]? It wouldn’t work without it.


#2

Always console.log(json_data). You will see that data.weather is an array that contains one object.


#3

ahhh, i get it.
so for everything inside { } is considered 1 object?

"weather": [
{
"id": 500,
"main": "Rain",
"description": "light rain",
"icon": "10n"
}
]

#4

Yes, that is correct.


#5

thank you again :grinning: