0

Possible Duplicate:
I have a nested data structure / JSON, how can I access a specific value?

I have an oddly formatted JSON string that looks like this and I'm trying to access the properties but not sure how to because of how its a bunch of json arrays within objects.

This stringified value of the variable data

  console.debug(JSON.stringify(data));

looks like this

[
{
    "note": [
        {
            "type": "2",
            "cid": "36",
            "icon": "cbb4153684de41ca61c0acc7124613b3.png",
            "created_at": "1359163643"
        }
    ],
    "count": 1
}
]

For example if I want the count int i tried

 var count = parseInt(data.count);

But that just results in NaN

Community
  • 1
  • 1
Brian
  • 4,328
  • 13
  • 58
  • 103

1 Answers1

5

data[0].count

Just like a normal array.

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592