Weather App- .weather not working from api. others fine, why?

Hi. Cant figure out why this is happening. Only .weather stuff is failing, I assume I am overlooking something obvious.

Using codepen’s bootstrap and jQuery.


<title>Weather in Las Vegas</title>
<div class='container'>
  <h1>Weather in Las Vegas</h1>
  <div class='row'>
    <div class="col-md-12">
        <li id='a'></li>
        <li id='b'></li>
        <li id='c'></li>
        <li id='d'></li>
        <li id='e'></li>
        <li id='f'></li>
        <li id='g'></li>




$.getJSON("", function(data){
var aa = data.coord.lon;
var bb =;
var cc =;
var dd =;
var ee = data.wind.speed;
var ff =;
var gg = data.main.pressure;

I cleaned up your code.
You need to use triple backticks to post code to the forum.
See this post for details.

Prophetic :wink:

Look at the weather section in the JSON:

"weather": [
      "id": 802,
      "main": "Clouds",
      "description": "scattered clouds",
      "icon": "03n"

Now look at your code:

var badVariableName =;

Hint: “weather” is not an object but an array with a nested object :sunglasses:

var badVariableName =[0].main;
1 Like

Thanks Isaac,
I thought I had tried that… :slight_smile:
Thanks for the clean up… I was editing (unsuccessfully) to correct the post while you replied.

NeverMind!!! lol
Can you tell me why it only fails for .weather? .main.pressure and others were working…-

lol, I do stuff like this all the time too :blush: